Hello,
Below are my models
[Table("categoryMaster")]
public class Category
{
public Category()
{
this.Products = new HashSet<Product>();
}
public int categoryID { get; set; }
public string categoryName { get; set; }
public string categoryImage { get; set; }
public virtual ICollection<Product> Products { get; set; }
}
[Table("productMaster")]
public class Product
{
public int productID { get; set; }
public int categoryID { get; set; }
public string productName { get; set; }
public string productImage { get; set; }
public string productDescription { get; set; }
public virtual Category Category { get; set; }
}
List<Product> productList = obj.Product.ToList();
Here I just need categoryID from categoryMaster and ProductID and ProductName from productMaster.
Go to the complete details ...