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; }
        }
  • 相关阅读:
    multiprocessing总结
    CPython在CPU密集型应用下的并发
    多线程交互
    线程等待与守护线程
    Python多线程(1)
    一个简单的单线程异步服务器
    多线程与多进程的实现
    socket的功能分割到不同函数
    数据处理项目Postmortem
    M2 终审
  • 原文地址:https://www.cnblogs.com/chucklu/p/11419374.html
Copyright © 2011-2022 走看看