• Mapping Pocos


    Mapping Pocos

    Example Pocos/Mappings

    public class Note
        {
            public int Id { get; set; }
    
            public DateTime CreatedOn { get; set; }
    
            public string Text { get; set; }
        }
     [ExplicitColumns]
        [TableName("Orders")]
        [PrimaryKey("Id")]
        public class Order
        {
            [Column]
            public int Id { get; set; }
    
            [Column]
            public Guid PersonId { get; set; }
    
            [Column]
            public string PoNumber { get; set; }
    
            [Column]
            public DateTime CreatedOn { get; set; }
    
            [Column]
            public string CreatedBy { get; set; }
    
            [Column("OrderStatus")]
        }
     [TableName("OrderLines")]
        [PrimaryKey("Id")]
        public class OrderLine
        {
            [Column]
            public int Id { get; set; }
    
            [Column]
            public int OrderId { get; set; }
    
            [Column(Name = "Qty")]
            public short Quantity { get; set; }
    
            [Column]
            public decimal SellPrice { get; set; }
    
            [ResultColumn]
            public decimal Total { get; set; }
        }
      [TableName("People")]
        [PrimaryKey("Id", AutoIncrement = false)]
        public class Person
        {
            [Column]
            public Guid Id { get; set; }
    
            [Column(Name = "FullName")]
            public string Name { get; set; }
    
            [Column]
            public long Age { get; set; }
    
            [Column]
            public int Height { get; set; }
    
            [Column]
            public DateTime? Dob { get; set; }
    
            [Ignore]
            public string NameAndAge => $"{Name} is of {Age}";
        }
     [TableName("TransactionLogs")]
        public class TransactionLog
        {
            public string Description { get; set; }
    
            public DateTime CreatedOn { get; set; }
        }
  • 相关阅读:
    Django(72)Django认证系统库--djoser
    Django(71)图片处理器django-imagekit
    python进阶(21)typing模块--类型提示支持
    Jmeter 参数化-文件和参数同时上传的场景
    Java线程监控之 jvisualvm 和 jstack
    操作系统监控
    Redis安装部署
    Mac下charles安装及配置
    Prometheus 监控平台部署
    Nginx配置(九)
  • 原文地址:https://www.cnblogs.com/chucklu/p/11419374.html
Copyright © 2020-2023  润新知