ServiceStack.OrmLite
2014-09-26 17:25
330 查看
LINQ很強大,不過有一點做不了,就是批量更新,刪除。而這個框架就實現了這個功能,令我喜出望外。
下載for sql server
PM> Install-Package ServiceStack.OrmLite.SqlServer -Version 4.0.30
http://www.nuget.org/packages/ServiceStack.OrmLite.SqlServer/4.0.30
https://github.com/ServiceStack/ServiceStack.OrmLite
1.[b]Dictionary returns a Dictionary made from the first two columns:[/b]
2.Lookup returns an
3.Reference Support, POCO style
OrmLite lets you Store and Load related entities in separate tables using
使用 ServiceStack.Text 序列化 json的实现代码
使用 ServiceStack.Text 序列化 json的实现代码
http://www.educity.cn/develop/688760.html
下載for sql server
PM> Install-Package ServiceStack.OrmLite.SqlServer -Version 4.0.30
http://www.nuget.org/packages/ServiceStack.OrmLite.SqlServer/4.0.30
https://github.com/ServiceStack/ServiceStack.OrmLite
1.[b]Dictionary returns a Dictionary made from the first two columns:[/b]
Dictionary<int, string> trackIdNamesMap = db.Dictionary<int, string>( "select Id, Name from Track")
2.Lookup returns an
Dictionary<K, List<V>>made from the first two columns:
Dictionary<int, List<string>> albumTrackNames = db.Lookup<int, string>( "select AlbumId, Name from Track")
3.Reference Support, POCO style
OrmLite lets you Store and Load related entities in separate tables using
[Reference]attributes in primary tables in conjunction with
{Parent}Idproperty convention in child tables, e.g:
public class Customer
{
[AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
[Reference] // Save in CustomerAddress table
public CustomerAddress PrimaryAddress { get; set; }
[Reference] // Save in Order table
public List<Order> Orders { get; set; }
}
public class CustomerAddress
{
[AutoIncrement]
public int Id { get; set; }
public int CustomerId { get; set; } //`{Parent}Id` convention to refer to Customer
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
}
public class Order
{
[AutoIncrement]
public int Id { get; set; }
public int CustomerId { get; set; } //`{Parent}Id` convention to refer to Customer
public string LineItem { get; set; }
public int Qty { get; set; }
public decimal Cost { get; set; }
}
使用 ServiceStack.Text 序列化 json的实现代码
使用 ServiceStack.Text 序列化 json的实现代码
http://www.educity.cn/develop/688760.html
相关文章推荐
- ServiceStack.OrmLite中的一些"陷阱"(3)
- ServiceStack.OrmLite 笔记10-group having 分页orderby等
- StackService.Ormlite解除使用限制
- ServiceStack.OrmLite 笔记
- ServiceStack OrmLite 数据库查询 几个实用方法 (继承表格式化集合等)
- 在线医疗平台开发实战05-StackService.Ormlite基本配置和数据库建模
- ServiceStack.OrmLite的参考资料(E文)
- ServiceStack.OrmLite破解
- ServiceStack.OrmLite调用存储过程
- ServiceStack.OrmLite 笔记2 -增
- ServiceStack.OrmLite 学习笔记3 建表
- ServiceStack.OrmLite 笔记4 删
- Oracle for .net & ServiceStack.OrmLite
- ServiceStack.OrmLite
- ServiceStack.OrmLite 笔记5 改
- ServiceStack.OrmLite 6 学习笔记 查
- 基于ServiceStack.OrmLite框架 代码性能、开发效率皆第一 没有之一
- ServiceStack.OrmLite T4模板使用记录
- ServiceStack.OrmLite 调用存储过程
- ServiceStack.OrmLite 学习笔记7-复杂点的使用1