How can i take following query for given object. I want take all the accountCall which belongs to perticular merchandizer
Here is object description
public class Account
{
public int Id { get; set; }
public int AccountGroupId { get; set; }
public int MerchandiserId { get; set; }
public int RouteId { get; set; }
public string AccountName { get; set; }
public string ContactFirstName { get; set; }
public string ContactLastName { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
public string Phone { get; set; }
public int Week { get; set; }
public int Day { get; set; }
public AccountGroup accountGroup { get; set; }
public Merchandiser merchandiser { get; set; }
public Route Route { get; set; }
public ICollection<CallActivity> callActivity { get; set; }
public ICollection<Product> product { get; set; }
public ICollection<ScheduledActivity> scheduledActivity { get; set; }
public ICollection<PreviousProductPricing> previousProductPricing { get; set; }
public ICollection<AccountCall> accountCall { get; set; }
public ICollection<StockLevel> stockLevel { get; set; }
}
public class AccountCall
{
public Guid Id { get; set; }
public int AccountId{get;set;}
public DateTime CallDate { get; set; }
public string AccountCallName
{
get
{
return CallDate.ToString() + " AccountId:" + AccountId.ToString();
}
}
public Account account { get; set; }
public ICollection<StockLevel> stockLevel { get; set; }
}
public class Merchandiser
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
public string Phone { get; set; }
public string Fax { get; set; }
public string Email { get; set; }
public bool Active { get; set; }
public string Password { get; set; }
public ICollection<Account> account { get; set; }
}
gslakmal
Member
118 Points
428 Posts
EF query
Mar 14, 2012 06:37 AM|LINK
Hi,
How can i take following query for given object. I want take all the accountCall which belongs to perticular merchandizer
Here is object description
public class Account { public int Id { get; set; } public int AccountGroupId { get; set; } public int MerchandiserId { get; set; } public int RouteId { get; set; } public string AccountName { get; set; } public string ContactFirstName { get; set; } public string ContactLastName { get; set; } public string Address { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } public string Phone { get; set; } public int Week { get; set; } public int Day { get; set; } public AccountGroup accountGroup { get; set; } public Merchandiser merchandiser { get; set; } public Route Route { get; set; } public ICollection<CallActivity> callActivity { get; set; } public ICollection<Product> product { get; set; } public ICollection<ScheduledActivity> scheduledActivity { get; set; } public ICollection<PreviousProductPricing> previousProductPricing { get; set; } public ICollection<AccountCall> accountCall { get; set; } public ICollection<StockLevel> stockLevel { get; set; } } public class AccountCall { public Guid Id { get; set; } public int AccountId{get;set;} public DateTime CallDate { get; set; } public string AccountCallName { get { return CallDate.ToString() + " AccountId:" + AccountId.ToString(); } } public Account account { get; set; } public ICollection<StockLevel> stockLevel { get; set; } } public class Merchandiser { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Address { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } public string Phone { get; set; } public string Fax { get; set; } public string Email { get; set; } public bool Active { get; set; } public string Password { get; set; } public ICollection<Account> account { get; set; } }