System.Data.SqlClient.SqlException: Invalid column name ‘Service_ID’

Error: System.Data.SqlClient.SqlException: Invalid column name ‘Service_ID’

Have two classes:

public class Product
{
   public Guid Id {get;set;}
   public IList<Service> Services {get;set;}
} 

public class Service
{
   public Guid Id {get;set;}
}

Missing the collection of Products on Reference. Try:

public class Product
{
   public Guid Id {get;set;}
   public ICollection<Service> Services {get;set;}
} 

public class Reference
{
   public Guid Id {get;set;}
   public ICollection<Product> Products {get;set;}
}

 

Related Posts

Add Comment

Website này sử dụng Akismet để hạn chế spam. Tìm hiểu bình luận của bạn được duyệt như thế nào.