C# Dapper基本三层架构使用 (二、Model)

我们将数据存放在数据库中,数据表的结构,我们通常会用一个类来抽象,表的属性就是类的属性,我们通常将表的一行存储在一个类中。
在Java中,通常将其称为实体类Entity,在C#中,通常将其称为Model。
 
这里使用的是Region表中的数据
C# Dapper基本三层架构使用 (二、Model)
在Model类库中增加类Region
C# Dapper基本三层架构使用 (二、Model)
代码如下
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Northwind.Model
{
    public class Region
    {
        public int RegionID { get; set; }
        public string RegionDescription { get; set; }
    }
}

相关推荐