c# - Combining data from different tables in one Datagridview -
conditions:
- list item
- .net 2.0
- winforms
- nhibernate
i have 2 classes
public class recipes { public virtual int id { get; set; } public virtual products product { get; set; } public virtual double weight { get; set; } } public class products { public virtual int id { get; set; } public virtual string name { get; set; } public virtual double cost { get; set; } }
i use nhibernate load data database
ilist<recipes> recipeslist = dbsession.createcriteria(typeof(recipes)).list<recipes>(); ilist<products> productslist = dbsession.createcriteria(typeof(products)).list<products>();
how can combine recipeslist , productslist in 1 datagridview possibility of editing?
one way create viewmodel
like
public class productsrecipes { public virtual int id { get; set; } public virtual int productid { get; set; } public virtual string productname { get; set; } public virtual double productcost { get; set; } public virtual double weight { get; set; } }
Comments
Post a Comment