hello
i want to read some data from database with entity framework.
<img src="http://i.stack.imgur.com/AhRq6.png">
this picture is my entity framework classes. i have some classes that they are commensurate with my entity framework classes for transfer data between functions.
<img src="http://i.stack.imgur.com/FGuR3.png">
<img src="http://i.stack.imgur.com/s5e1Y.png">
now i want to read all rows from tblCenterShop and fill CenterShop classes with them.
my problem is that CenterShop classes contain a list of centerShopImage (images). pelase help me to fill images proprty of CenterShop class?
my function is in bellow :
public IEnumerable<Model.CenterShop> GetAllCenterShops()
{
CenterShopSimulationEntities db = Repository.RepositoryManager.GetDB();
return from c in db.tblCenterShop
select new Model.CenterShop
{
ID = c.ID,
address = c.address,
category = new Model.CenterShopCat()
{
ID = c.tblCenterShopCat.ID,
name = c.tblCenterShopCat.name
},
floorNumber = c.floorNumber,
name = c.name,
};
}
thanks.