Is it possible with BLToolKit (http://bltoolkit.net) to create a set of records for list of object (batch insert)?
If yes, how is this possible?
Thanks a lot!
3 Answers
answered 2010-11-26 17:06:54
#1
using (var db = new DbManager())
db.InsertBatch(list);
answered 2010-11-26 17:18:00
#2
using (var db = new DbManager())
{
db.SetSpCommand("Person_Insert")
.ExecuteForEach<Person>(list);
}
Where list
is provided by other means of your application functionality.
answered 2013-06-06 09:02:18
#3
using (var db = new DbManager())
{
var ret = (from s in db.tablename
select new ObjectList
{
Id = (int)s.Id,
Name = s.Name
}).ToList();
return ret;
}