首页 > 其他 > 详细

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

时间:2014-04-07 11:44:23      阅读:511      评论:0      收藏:0      [点我收藏+]

 

1、下载并安装动软代码生成器

2、下载vJine.Core.Orm模板

3、解压模本文件并复制到如下的动软代码生成器模板目录;

bubuko.com,布布扣

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

bubuko.com,布布扣

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

bubuko.com,布布扣

 

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

bubuko.com,布布扣

 

bubuko.com,布布扣

 

7、生成成功后产生如下代码,如果您阅读前篇博文,通过对比会发现属性"MyStatus"为整形而非枚举类型,这一点需要特别注意。

 

bubuko.com,布布扣
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");
                }
            }
        }
    }
}
bubuko.com,布布扣

 

 

 

 

轮子来袭 vJine.Core Orm 之 02_代码生成,布布扣,bubuko.com

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

原文:http://www.cnblogs.com/vjine/p/vJine_Core_Orm_02.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!