vJine.Core 是.Net环境下C#类库,在其包含的众多功能中ORM功能尤为突出,现简介如下。

一、支持的数据库:

  SQLite, MySQL, MS SQL, Oracle。

二、使用方法:

  0.添加引用:

    库文件vJine.Core.dll,

    

using vJine.Core;
using vJine.Core.ORM;

  1.定义类:

using System;
using System.Collections.Generic;
using System.Text;
using vJine.Core.Base;
using vJine.Core.IO;
using vJine.Core.ORM; namespace vJineCore_QuickStart.BML { public class My_Model : ItemBase /*不是必须继承*/ {
public My_Model() {
this.ID = Guid.NewGuid().ToString("N");
} public partial class _ {
public static readonly Property<My_Model, string> ID = new Property<My_Model, string>("ID");
}
string _ID;
[Key(IsPrimary=true)] //指定主键
public string ID {
get {
return this._ID;
}
set {
if (value != this._ID) {
this._ID = value;
this.NotifyPropertyChanged("ID");
}
}
} bool _IsActive;
public bool IsActive {
get {
return this._IsActive;
}
set {
if (value != this._IsActive) {
this._IsActive = value;
this.NotifyPropertyChanged("IsActive");
}
}
} public enum Status:byte {
Unknown = ,
Ready = ,
Running = ,
Done =
} Status _MyStatus;
public partial class _ {
public static readonly Property<My_Model, Status> MyStatus = new Property<My_Model, Status>("MyStatus");
}
public Status MyStatus { //支持枚举类型
get {
return this._MyStatus;
}
set {
if (value != this._MyStatus) {
this._MyStatus = value;
this.NotifyPropertyChanged("MyStatus");
}
}
} public partial class _ {
public static readonly Property<My_Model, int> Qty = new Property<My_Model, int>("Qty");
}
int _Qty;
public int Qty {
get {
return this._Qty;
}
set {
if (value != this._Qty) {
this._Qty = value;
this.NotifyPropertyChanged("Qty");
}
}
} DateTime _Stamp;
public DateTime Stamp {
get {
return this._Stamp;
}
set {
if (value != this._Stamp) {
this._Stamp = value;
this.NotifyPropertyChanged("Stamp");
}
}
}
}
}

  2.配置连接:

    

<connectionStrings>
<add name="Default" providerName="System.Data.SqlClient" connectionString="Data Source=.;Initial Catalog=【数据库名称】;Integrated Security=True"/>
</connectionStrings>

注:请将【数据库名称】改为你本地对应的数据库名。

  3.新建实例:

    

DataManager dm = new DataManager(); //引用Default配置
DataManager dm = new DataManager("specific_name"); //引用指定配置

  4.创建数据表:

    

//Create Table
dm.Create<My_Model>();

  5.增删改查:

My_Model new_data = new My_Model() {
Qty = , IsActive = false, MyStatus = My_Model.Status.Ready
};
new_data.Stamp = dm.Now;
dm.I<My_Model>(new_data);
dm.D<BML.My_Model>(BML.My_Model._.ID == "xxx");
dm.U<BML.My_Model>(My_Model._.Qty.EQ(My_Model._.Qty + 1) & My_Model._.MyStatus.EQ(My_Model.Status.Running), My_Model._.MyStatus == My_Model.Status.Ready);
List<My_Model> container = new List<My_Model>();
//先定义一个实现IList<>接口的对象容器,查询结果将累加填充
dm.Q<My_Model>(container, My_Model._.ID.Like("ABC%") & My_Model._.Qty > );

三、附件:

  1、vJine.Core

四、附注:

  1、默认连接配置为 MS SQL Server,未保证测试顺利进行,请优先使用MS SQL Server, connectionString请依据您服务器的实际情况更改。

  2、本篇仅作为功能体验的引导文章,后续将陆续推出使用细则、架构设计等相关内容。

  3、vJine.Core将已开源模式提供,可用免费于私人和商业用途,但作者本人不反使用者通过以下方式给以赞同(顶贴、点赞、推荐)。

  4、关于性能:性能方面个人暂无比较,如有热衷于这方面的朋友帮忙做个测试,将不胜感激。

  5、vJine.Core的目标是:简洁、高效、轻量级、非侵入。

轮子来袭 vJine.Core Orm 之 01_快速体验的更多相关文章

  1. 轮子来袭 vJine.Core Orm 之 03_架构分析

    1.vJine.Core ORM 架构: 如上图所示,vJine.Core ORM的特点如下: 所有操作均以DataManager为核心: DataManager业务部分的增删改查操作依赖于Class ...

  2. 轮子来袭 vJine.Core Orm 之 04_使用进阶

    1.配置文件: 框架默认情况下支持"connectionStrings"的配置方式,如<轮子来袭 vJine.Core Orm 之 01_快速入门>所述: 框架的进阶设 ...

  3. 轮子来袭 vJine.Core Orm 之 02_代码生成

    1.下载并安装动软代码生成器: 2.下载vJine.Core.Orm模板: 3.解压模本文件并复制到如下的动软代码生成器模板目录: 4.打开动软代码生成器会看到模板已识别加载: 5.选择模板代码批量生 ...

  4. 轮子来袭 vJine.Core 之 AppConfig<T>

    1.引用vJine.Core; 2.定义配置类; using System; using System.Collections.Generic; using System.Text; using Sy ...

  5. .NET Core前后端分离快速开发框架(Core.3.0+AntdVue)

    .NET Core前后端分离快速开发框架(Core.3.0+AntdVue) 目录 引言 简介 环境搭建 开发环境要求 基础数据库构建 数据库设计规范 运行 使用教程 全局配置 快速开发 管理员登录 ...

  6. [转].NET Core前后端分离快速开发框架(Core.3.0+AntdVue)

    [转].NET Core前后端分离快速开发框架(Core.3.0+AntdVue) 目录 引言 简介 环境搭建 开发环境要求 基础数据库构建 数据库设计规范 运行 使用教程 全局配置 快速开发 管理员 ...

  7. vJine.Core 0.3.0.49 正式发布

    nuget: https://www.nuget.org/packages/vJine.Core/ oschina: http://git.oschina.net/vjine/vJine.Core/a ...

  8. .Net Core ORM选择之路,哪个才适合你 通用查询类封装之Mongodb篇 Snowflake(雪花算法)的JavaScript实现 【开发记录】如何在B/S项目中使用中国天气的实时天气功能 【开发记录】微信小游戏开发入门——俄罗斯方块

    .Net Core ORM选择之路,哪个才适合你   因为老板的一句话公司项目需要迁移到.Net Core ,但是以前同事用的ORM不支持.Net Core 开发过程也遇到了各种坑,插入条数多了也特别 ...

  9. .Net Core 3.0 IdentityServer4 快速入门

    .Net Core 3.0 IdentityServer4 快速入门 一.简介 IdentityServer4是用于ASP.NET Core的OpenID Connect和OAuth 2.0框架. 将 ...

随机推荐

  1. 转载 深入理解JavaScript中的this关键字

    转载原地址: http://www.cnblogs.com/rainman/archive/2009/05/03/1448392.html 深入理解JavaScript中的this关键字   1. 一 ...

  2. 用EPOLL进行压力测试

    在以前的博客中提到的一个服务端,在以前压力测试的过程中,发现单核CPU最多能达到1000TPS 还以为是服务端性能不够好,所以一直想着怎么去优化它. 但优化的思路明显不多,所以就考虑换一种压力测试的方 ...

  3. php中带mb的字符串处理函数

    int strlen ( string $string ) int mb_strlen ( string $str [, string $encoding ] ) encoding参数为字符编码.如果 ...

  4. http协议分析工具

    资源推荐 1.Wireshark抓包软件 Wireshark(前称Ethereal)是一个网络封包分析软件.网络封包分析软件的功能是撷取网络封包,并尽可能显示出最为详细的网络封包资料.Wireshar ...

  5. 【C++编程规范】编程需要避免的常见错误

    前言 C++有不少陷阱或者容易失误的地方,稍不注意就会导致程序bug. 正文 1.无符号数和有符号数比较 #define只是简单的文本替换,如果替换的是简单数值,默认是int,和unsigned in ...

  6. 【斐波那契DP】HDU 4639——HeHe

    题目:点击打开链接 多校练习赛4的简单题,但是比赛的时候想到了推导公式f(n)=f(n-1)+f(n-2)(就是斐波那契数列),最后却没做出来. 首先手写一下he(不是hehe)连续时的规律.0-1 ...

  7. 【07】为多态基类声明virtual析构方法

    1.考虑下面的需要,需要一个工厂方法.工厂方法的规则是:在堆上分配一个子类对象,并返回父类指针.使用完毕,delete父类指针.如果父类的析构方法不是virtual,将直接调用父类的析构方法,导致局部 ...

  8. MFC——AfxParseURL用法

    1.功能: 该函数解析URL字符串并返回服务的类型及组件,包含在 afxinet.h 头文件中. 2.定义 BOOL AFXAPI AfxParseURL(LPCTSTRpstrURL,DWORD&a ...

  9. java nio 抛出NonWritableChannelException异常

    抛出异常的代码在此处: MappedByteBuffer buffer = channel.map(MapMode.READ_WRITE, 0, avalible); 其中channel是一个file ...

  10. eclipse启动不了报错java was started but returned exit code=13

    http://zhidao.baidu.com/question/1367307106041927459.html http://zhidao.baidu.com/question/570567914 ...