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

About The Author

Add Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.