Google+ Peter Bromberg's .NET Blog | How to Use OrmLite's SelectMulti Feature

Peter Bromberg's .NET Blog All Things Programming

How to Use OrmLite's SelectMulti Feature

10. July 2016 15:07 by admin in

 using (var db = new SqlConnection(ConfigurationManager.ConnectionStrings["TEST"].ConnectionString))

            {

                db.Open();

                OrmLiteConfig.DialectProvider = SqlServer2012OrmLiteDialectProvider.Instance;

                OrmLiteConfig.DialectProvider.NamingStrategy = new OrmLiteNamingStrategyBase();

 

                var q = db.From<Customer>()

                       .Join<Customer, Order>((cust,ord)=>cust.CustomerID==ord.CustomerID)

                       .Join<Order,Order_Detail >((ord,orddet)=>ord.OrderID==orddet.OrderID);

                var results = db.SelectMulti<Customer, Order_Detail, Order>(q);

   }

Add comment

  Country flag


Loading