I have Classes like this as shown below:
public class HomeRoot
{
public int pID { set; get; }
public string PName { set; get; }
public int Pparent { set; get; }
public List<HomeSubCat> HomeSubCatList { set; get; }
}
public class HomeSubCat
{
public int sCatID { set; get; }
public string sCatName { set; get; }
public int sCatParent { set; get; }
public List<HomeProduct> HomeProductlist { set; get; }
}
public class HomeProduct
{
public int PrId { set; get; }
public int PrItemId { set; get; }
public string PrName { set; get; }
public string PrUrl { set; get; }
public string Prcomp { set; get; }
public string PrImage { set; get; }
public decimal PrMrp { set; get; }
public decimal PrSrate { set; get; }
}
and Store procedure is like as shown below:
alter proc sp_aa_aspnetGetHometemp
as
begin
select pCat.Id pID,pcat.Name PName,pcat.Parent_Id Pparent,sCat.Id sCatID,scat.Name sCatName,scat.Parent_Id sCatParent,p.Id PrId,p.ItemId PrItemId,p.Name PrName,p.FriendlyUrl PrUrl,p.Compname Prcomp,pImg.FileName PrImage,i.Mrp PrMrp,i.Srate PrSrate from tbl_aa_aspnet_Categories pCat
inner join tbl_aa_aspnet_Categories sCat on(sCat.Parent_Id = pCat.Id and sCat.Id in (select top 4 id from tbl_aa_aspnet_Categories where Parent_Id=pCat.Id and ShowHome=1 and IsDelete=0))
inner join tbl_aa_aspnet_ProductAssociation PA on(PA.CategoryId=sCat.Id)
inner join tbl_aa_aspnet_Product p on(p.Id= PA.ProductId and p.ShowHome=1 )
inner join tbl_aa_aspnet_ProductImages pImg on(p.Id= pImg.ProductId and pImg.id=(select Top 1 id from tbl_aa_aspnet_ProductImages where IsDelete=0 and ProductId=p.Id ))
inner join item i on(p.ItemId=i.code)
where pCat.ShowHome=1 and pCat.IsDelete=0
order by pcat.Rank, sCat.Rank
end
I want to convert this store procedure data into my model using then i would be ableto display details on the front.
Please help.