Linked Questions

Popular Questions

LazyLoading is disabled on my project. I want to get Product which is Id = 1 with Category navigation property of it. But I need just Id and Name properties of Category. That's why I want Category navigation property to has only these two fields.Is it possible to create such a query ?

public class Product
{
    public int Id { get; set; }
    public string Name { get; set; } 
    public dobule Price{ get; set; }
    public string Description { get; set; }
    public bool IsDeleted { get; set; }       
    public DateTime CreatedDate { get; set; }   
    public DateTime ModifiedDate { get; set; }      

    public int CategoryId{ get; set; }
    public Category Category{ get; set; }  
}

public class Category
{
    public int Id { get; set; }
    public string Name { get; set; } 
    public dobule Description{ get; set; }
    public Category IsDeleted { get; set; }       
    public DateTime CreatedDate { get; set; }   
    public DateTime ModifiedDate { get; set; } 
}

Related Questions