i am getting error during the creation of View ? i am using multiple table in single model

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShopInDeal.ViewModels
{
class BusinessViewModel
{
//BusinessTable (table name)
public int ShopId { get; set; }
public string ShopName { get; set; }
public Nullable FlagApproval { get; set; }
public Nullable Createdby { get; set; }
public Nullable CreatedOn { get; set; }
public Nullable UpdatedBy { get; set; }
public Nullable UpdatedOn { get; set; }
public Nullable Active { get; set; }
//BusinessLocation (table name)
public int LocationID { get; set; }
public string Location { get; set; }
//public Nullable ShopId { get; set; }
public string Longitude { get; set; }
public string Latitude { get; set; }
//public Nullable Createdby { get; set; }
//public Nullable CreatedOn { get; set; }
//public Nullable UpdatedBy { get; set; }
//public Nullable UpdatedOn { get; set; }
//public Nullable Active { get; set; }
//Business_CatagoryRelation (table name)
public int shopcategoryrelationid { get; set; }
public Nullable shopId { get; set; }
public Nullable CategoryId { get; set; }
//public Nullable Createdby { get; set; }
//public Nullable CreatedOn { get; set; }
//public Nullable UpdatedBy { get; set; }
//public Nullable UpdatedOn { get; set; }
//public Nullable Active { get; set; }
//Business_SubCatagoryRelation (table name)
public int shopsubcategoryrelationid { get; set; }
//public Nullable shopId { get; set; }
//public Nullable CategoryId { get; set; }
public Nullable SubCategoryId { get; set; }
//public Nullable Createdby { get; set; }
//public Nullable CreatedOn { get; set; }
//public Nullable UpdatedBy { get; set; }
//public Nullable UpdatedOn { get; set; }
//public Nullable Active { get; set; }
}
}

David GálvezPosted Jun 13, 2016, 7:39 AM
Hi,
you must define the key per table.
check that the tables have defined the key
Vinay SinghPosted Jun 10, 2016, 4:48 AM