ServiceStack.OrmLite
来源:互联网 发布:javascript插件是什么 编辑:程序博客网 时间:2024/05/20 22:35
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.Dictionary returns a Dictionary made from the first two columns:
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}Id
property 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
- ServiceStack.OrmLite调用存储过程
- Oracle for .net & ServiceStack.OrmLite
- ServiceStack
- 基于ServiceStack.OrmLite框架 代码性能、开发效率皆第一 没有之一
- ormlite
- ORMLite
- OrmLite
- ServiceStack Test
- ServiceStack简介
- ServiceStack.Redis
- ServiceStack.Redis 使用教程
- ServiceStack.Redis 使用教程
- ServiceStack.Redis 使用教程
- ServiceStack.Redis操作Hash
- ServiceStack.Redis 学习笔记
- ServiceStack.Redis之IRedisClient
- ServiceStack.Redis 使用教程
- 【官方文档】Cocos2d-x v3.0 渲染流水线 路线图
- (android高仿系列)今日头条 --新闻阅读器 (一)
- 黑马程序员--C语言入门疑难点----进制,文件
- Introduction To The Smart Client Software Factory (CAB/SCSF Part 18)
- 解析活动配置表奖励道具
- ServiceStack.OrmLite
- 工作平台简介
- MySql数据库的基本操作-入门(ubuntu14)
- Business Modules And Interfaces In The SCSF Smart Client Solution (Introduction To CAB/SCSF Part 19)
- 49个JQuery代码经典片段
- Windows VisualStudio 下使用glog gflags
- Android基础知识资料收集
- linux 笔记 关于struct file 结构下 private_data 数据结构的思考
- ora-12154:tns:无法解析指定的连接标识符(解决办法)