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

时间:2020-05-02 12:14:19   收藏:0   阅读:77
我们将数据存放在数据库中,数据表的结构,我们通常会用一个类来抽象,表的属性就是类的属性,我们通常将表的一行存储在一个类中。
在Java中,通常将其称为实体类Entity,在C#中,通常将其称为Model。
 
这里使用的是Region表中的数据
技术图片
在Model类库中增加类Region
技术图片
代码如下
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; }
    }
}

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!