zoukankan      html  css  js  c++  java
  • 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; }
        }
  • 相关阅读:
    CF1132G
    CF1129B
    CF1131G
    CF1109D
    CF1110H
    CF1106F
    my.cnf 配置
    mysql 导入导出
    mysql 批量删除表数据
    国内开源镜像站
  • 原文地址:https://www.cnblogs.com/chucklu/p/11419374.html
Copyright © 2011-2022 走看看