• 轮子来袭 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");
                    }
                }
            }
        }
    }
  • 相关阅读:
    远程连接Mysql报错 java.sql.SQLException:null,message from server ... is not allowed to connect
    使用 java.util.Properties 读取配置文件中的参数
    重载Prometheus配置
    Redis的 SLAVEOF 命令
    Redis为什么不能使用一主一从哨兵
    iptables添加开放端口
    解决172.17 或者172.18 机房环境下harbor服务器不通的问题
    利用sshpass批量导入ssh-key
    ZABBIX_PROXy
    zabbix_server.conf
  • 原文地址:https://www.cnblogs.com/vjine/p/vJine_Core_Orm_02.html
Copyright © 2020-2023  润新知