The. NET C #-based SQLite database ORM "Easyliter"

Source: Internet
Author: User
Tags sqlite sqlite database

Because the work is often used in the SQLite database, but can not find a good orm so self-organized a simple and easy to use the light-weight ORM Framework: Easyliter

Feature Description:

1. Support SQL statement operation

2, Support List<t> and DataTable two return format

3, support lambda expression display for data query and paging

4. Built-in entity class function

5. Dependent on System.Data.SQLite

Here's how to use it:

  Static voidMain (string[] args) {            varConnStr ="datasource="+ System.AppDomain.CurrentDomain.BaseDirectory +"Mapping.sqllite"; //dependent on the System.Data.SQLiteEasyliter e =NewEasyliter (CONNSTR); //To create a class from a database            varCreateCalss1 = E.CREATECALSS ("Sqlite.model"/*name Space*/,@"d:\ Work \sqlite\sqlite\model"/*Path*/); //create a class from a SQL statement, and a multi-table query will use            varCreateCalss2 = E.createcalssbysql ("Sqlite.model",@"d:\ Work \sqlite\sqlite\model","viewproduct","Select Id,sku from Product"); //Delete//e.delete<product> (100); //e.delete<product> (new int [] {n/a}); //Update//e.update<product> (New {sku = "x2", category_id=1}, new {id=434});            ////Add            //Product P = new Product ()//{            //category_id = 2,//SKU = "SKU",//title = "title"//}; //e.insert<product> (p);            ////based on SQL querylist<product> list = e.select<product> ("SELECT * from product where id> @num",New{num= - }); //Unconditionallist<category> List2 = e.select<category>(); //Single ConditionList<product> list3 = e.select<product> (x=>x.id> $); //Multi-Criterialist<product> List4 = e.select<product> (x = x.id > $, x= x.sku=="skx"|| x.sku==NULL); //Multi-condition paging            intCount =0; List<Product> list5 = e.selectpage<product> (1,Ten,refCount"ID desc", x=>x.id >Ten,//Condition 1X=>true);//Condition 2 ... Condition N//var dt = e.getdatatable ("SELECT * from product ORDER BY id DESC");        }

Source Address:Http://git.oschina.net/sunkaixuan/Easyliter

The. NET C #-based SQLite database ORM "Easyliter"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.