轮子来袭 vJine.Core Orm 之 02_代码生成
1、下载并安装动软代码生成器;
2、下载vJine.Core.Orm模板;
3、解压模本文件并复制到如下的动软代码生成器模板目录;

4、打开动软代码生成器会看到模板已识别加载;

5、选择模板代码批量生成;

6、在弹出的对话框中依据需要选择,此例选择上一篇博文中生成的My_Model表;


7、生成成功后产生如下代码,如果您阅读前篇博文,通过对比会发现属性"MyStatus"为整形而非枚举类型,这一点需要特别注意。
using System;
using System.Xml.Serialization; using vJine.Core.Base;
using vJine.Core.IO;
using vJine.Core.ORM; namespace vJine.Modules.LOT.BML
{
[Serializable]
public partial class My_Model : ItemBase
{ public partial class _
{
public static readonly Property<My_Model, string> ID = new Property<My_Model, string>("ID");
}
private string _ID;
[XmlAttribute("ID")]
[Map(IsPrimary=true)]
public string ID
{
get
{
return this._ID;
}
set
{
if (this._ID != value)
{
this._ID = value;
this.NotifyPropertyChanged("ID");
}
}
} public partial class _
{
public static readonly Property<My_Model, bool> IsActive = new Property<My_Model, bool>("IsActive");
}
private bool _IsActive;
[XmlAttribute("IsActive")]
public bool IsActive
{
get
{
return this._IsActive;
}
set
{
if (this._IsActive != value)
{
this._IsActive = value;
this.NotifyPropertyChanged("IsActive");
}
}
} public partial class _
{
public static readonly Property<My_Model, int> MyStatus = new Property<My_Model, int>("MyStatus");
}
private int _MyStatus;
[XmlAttribute("MyStatus")]
public int MyStatus
{
get
{
return this._MyStatus;
}
set
{
if (this._MyStatus != value)
{
this._MyStatus = value;
this.NotifyPropertyChanged("MyStatus");
}
}
} public partial class _
{
public static readonly Property<My_Model, int> Qty = new Property<My_Model, int>("Qty");
}
private int _Qty;
[XmlAttribute("Qty")]
public int Qty
{
get
{
return this._Qty;
}
set
{
if (this._Qty != value)
{
this._Qty = value;
this.NotifyPropertyChanged("Qty");
}
}
} public partial class _
{
public static readonly Property<My_Model, DateTime> Stamp = new Property<My_Model, DateTime>("Stamp");
}
private DateTime _Stamp;
[XmlAttribute("Stamp")]
public DateTime Stamp
{
get
{
return this._Stamp;
}
set
{
if (this._Stamp != value)
{
this._Stamp = value;
this.NotifyPropertyChanged("Stamp");
}
}
}
}
}
轮子来袭 vJine.Core Orm 之 02_代码生成的更多相关文章
- 轮子来袭 vJine.Core Orm 之 03_架构分析
1.vJine.Core ORM 架构: 如上图所示,vJine.Core ORM的特点如下: 所有操作均以DataManager为核心: DataManager业务部分的增删改查操作依赖于Class ...
- 轮子来袭 vJine.Core Orm 之 04_使用进阶
1.配置文件: 框架默认情况下支持"connectionStrings"的配置方式,如<轮子来袭 vJine.Core Orm 之 01_快速入门>所述: 框架的进阶设 ...
- 轮子来袭 vJine.Core Orm 之 01_快速体验
vJine.Core 是.Net环境下C#类库,在其包含的众多功能中ORM功能尤为突出,现简介如下. 一.支持的数据库: SQLite, MySQL, MS SQL, Oracle. 二.使用方法: ...
- 轮子来袭 vJine.Core 之 AppConfig<T>
1.引用vJine.Core; 2.定义配置类; using System; using System.Collections.Generic; using System.Text; using Sy ...
- vJine.Core 0.3.0.49 正式发布
nuget: https://www.nuget.org/packages/vJine.Core/ oschina: http://git.oschina.net/vjine/vJine.Core/a ...
- .Net Core ORM选择之路,哪个才适合你 通用查询类封装之Mongodb篇 Snowflake(雪花算法)的JavaScript实现 【开发记录】如何在B/S项目中使用中国天气的实时天气功能 【开发记录】微信小游戏开发入门——俄罗斯方块
.Net Core ORM选择之路,哪个才适合你 因为老板的一句话公司项目需要迁移到.Net Core ,但是以前同事用的ORM不支持.Net Core 开发过程也遇到了各种坑,插入条数多了也特别 ...
- [最新].NET Core ORM 开源项目一览,持续更新
截至2019-05-08共收集27个 .NET Core ORM 开源项目,38个 .NET ORM 开源项目. .NET Core ORM 开源项目收集地址:https://github.com/o ...
- .Net Core ORM选择之路,哪个才适合你
因为老板的一句话公司项目需要迁移到.Net Core ,但是以前同事用的ORM不支持.Net Core 开发过程也遇到了各种坑,插入条数多了也特别的慢,导致系统体验比较差好多都改写Sql实现. 所以我 ...
- 五一干货来袭!开源Moon.Orm标准版发布!
标准版源代码下载: 链接:http://pan.baidu.com/s/1i3xj0f7 因五一早过(现在中旬了),解压码获取请到: http://www.cnblogs.com/humble/p/3 ...
随机推荐
- Open War I: 怪物繁殖,行走仿真,瞄准射击...
See below demo: Share the source codes with your guys. >>>download this "hacking meat& ...
- 使用Redis bitmaps进行快速、简单、实时统计
原文:Fast, easy, realtime metrics using Redis bitmaps (http://blog.getspool.com/2011/11/29/fast-easy-r ...
- 好的 ASP.Net网站、博客
1.优秀的个人技术博客 http://www.tracefact.net/Asp-Net/
- Remastersys打包你自己的ubuntu成iso文件,保存原来的所有配置
你是不是辛辛苦苦地配好了ubuntu结果不久又重装,然后又重新配置很久呢? 笔者好不容易配置好了torch,但是换硬盘,于是就想到了将ubuntu打包成iso文件,下次直接安装,然后配置好的东西都搬过 ...
- iOS开发-分页栏和选取器的使用
一.分页栏 创建一个新的项目,Subclass of的值选中UIViewController,然后在storyboard中删除根视图,在右下方拖出一个Tab Bar Controller 新增分页,只 ...
- linux 常用命令 -- 系统管理工具包: 监视邮件的使用情况
清单 5. 获得磁盘使用情况统计信息 $ du -sk * 20 admin 1020 appleby 45828 applicants 13264 buy 11704 dev 11200 finan ...
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 44 bytes) in
最近莫名出现这个错误. 研究一下原因很奇葩呢. 原因:sql获取数据库中数据,取出数据赋给变量,数据太多,超过memory_limit内存设置了. 解决方法:设置memory_limit不建议.优化代 ...
- iOS快速集成检查更新
一直以为Appstore有了检查版本是否更新的机制,我们在APP上做这个更新功能会被拒,但是也有看到一些APP也是做了这个更新功能的.因为在网上没有找到完全正确的方法能获取到iTunes里的数据的,于 ...
- isstream例子
假如有一个文件,列出了一些人和他们的电话号码.某些人只有一个号码,而另外一些人则有多个——家庭电话.工作电话.移动电话等.我们的输入文件看起来是这样的: morgan 2015552368 86255 ...
- [JavaScript]转--如何让JS代码高大上
原文出处:http://www.cnblogs.com/wenber/p/3630373.html 1,创造简短的写法 你可以这么写: 1 var slice = Array.prototype.sl ...