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_代码生成的更多相关文章

  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 之 01_快速体验

    vJine.Core 是.Net环境下C#类库,在其包含的众多功能中ORM功能尤为突出,现简介如下. 一.支持的数据库: SQLite, MySQL, MS SQL, Oracle. 二.使用方法: ...

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

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

  5. vJine.Core 0.3.0.49 正式发布

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

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

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

  7. [最新].NET Core ORM 开源项目一览,持续更新

    截至2019-05-08共收集27个 .NET Core ORM 开源项目,38个 .NET ORM 开源项目. .NET Core ORM 开源项目收集地址:https://github.com/o ...

  8. .Net Core ORM选择之路,哪个才适合你

    因为老板的一句话公司项目需要迁移到.Net Core ,但是以前同事用的ORM不支持.Net Core 开发过程也遇到了各种坑,插入条数多了也特别的慢,导致系统体验比较差好多都改写Sql实现. 所以我 ...

  9. 五一干货来袭!开源Moon.Orm标准版发布!

    标准版源代码下载: 链接:http://pan.baidu.com/s/1i3xj0f7 因五一早过(现在中旬了),解压码获取请到: http://www.cnblogs.com/humble/p/3 ...

随机推荐

  1. 5A的肖特基二极管 SK5x / SK5xx

    5A的肖特基 管压降经实测2A/0.3V, SK5x 和SK5xx别在于前者是四位命名,后者是一个五位命名带B, 封装不一样,参数基本一致.不细看手册容易用错了. 四位命名:封装为SMC (DO-21 ...

  2. Oracle- 表的自增长创建

    Oracle创建自增长要先写序列还要去写触发器,不像MSSQLSERVER那样方便.但也是麻烦,记录如下: Oracle中,可以为每张表的主键创建一个单独的序列,然后从这个序列中获取自动增加的标识符, ...

  3. 查看linux中的TCP连接数【转】

     转自:http://blog.csdn.net/he_jian1/article/details/40787269 查看linux中的TCP连接数 本文章已收录于:   计算机网络知识库  分类: ...

  4. HTML5要点(二)

    <p> <b>今天周一</b>,<span>呵呵呵呵呵...</span> </p> <i>斜体文字</i&g ...

  5. NSArrary和NSString间的转换

    将string字符串转换为array数组 NSArray  *array = [Str componentsSeparatedByString:@","]; // 注意:NSArr ...

  6. WinForm开发中针对TreeView控件改变当前选择节点的字体与颜色

    本文转载:http://www.cnblogs.com/umplatform/archive/2012/08/29/2660240.html 在B/S开发中,对TreeView控件要改变当前选中节点的 ...

  7. cocos2d-x 开发时的注意点

    转自:http://cjhworld.blog.163.com/blog/static/20707803620132693629307/ 1.       按照Cocos2d的编程风格,尽量少用构造函 ...

  8. ubuntu安装mysql后不能远程访问的方法

    ubuntu安装mysql后不能远程访问的方法1.mysql>GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassw ...

  9. [AngularJS] Best Practise - Resolve promises in router, defer controllers

    See more:http://toddmotto.com/opinionated-angular-js-styleguide-for-teams/ /** * Created by Answer12 ...

  10. dtrace4linux_Example

    http://www.slideshare.net/brendangregg/what-linux-can-learn-from-solaris-performance-and-viceversa/8 ...