c# - Combining data from different tables in one Datagridview -


conditions:

  1. list item
  2. .net 2.0
  3. winforms
  4. 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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -