Skip to content
sunkaixuan edited this page May 7, 2019 · 11 revisions

Some common functions

Use case

var list = db.Utilities.DataTableToList(datatable);

API

Name Description Return type
DataReaderToExpandoObject ExpandoObject
DataReaderToExpandoObjectList List
DataReaderToList List
SerializeObject string
DeserializeObject string
TranslateCopy T
DeserializeObject T
DataTableToDynamic dynamic
DataTableToList List
DataTableToDictionary Dictionary<string, object>
RemoveCacheAll Clear the cache in ORM
PageEach Memory Page

PageEach

List<int> ids = Enumerable.Range(1, 100000).ToList();
db.Utilities.PageEach(ids, 10, list =>
{
  //list.Count()==10
});
Clone this wiki locally