zoukankan      html  css  js  c++  java
  • 实体书写的注意事项

    [Chloe.Annotations.TableAttribute("MN_FloDrawing")]
    //上面一行代码表示,查询时对应的表名
        public class Vw_MN_FloDrawing:BindableBase
        {
            private int _id;
            /// <summary>
            /// 表示对应主键的字段,默认识别的是ID
            /// </summary>	
            [Chloe.Annotations.ColumnAttribute("ID", IsPrimaryKey = true)]
            public int ID
            {
                get => _id;
                set => SetProperty(ref _id, value);
            }
    
           private string _projectNo;
            /// <summary>
            /// 表示查询实体时忽略此字段
            /// </summary>	
            [Chloe.Annotations.NotMappedAttribute]
            public string ProjectNo
            {
                get => _projectNo;
                set => SetProperty(ref _projectNo, value);
            }  
    }
    

     上面的样式的实体代码

     1.context.Insert(mainFlowData);时识别的是不带NotMappedAttribute的表字段
     2.context.Query<Vw_BD_FloPriceOfCommonditiesItems>().Where(w => w.MainID == flowData.ID).ToList().ToObservableCollection();
    
    
  • 相关阅读:
    spring mvc 数据格式化
    spring mvc 数据转换
    spring mvc
    spring
    java+hibernate+mysql
    Jenkins使用TFS部署
    Docker基本命令
    MySQL主从配置
    Jenkins邮箱设置
    vlc 控件属性和方法
  • 原文地址:https://www.cnblogs.com/mamaxiaoling/p/14545600.html
Copyright © 2011-2022 走看看