文章目录
1. 创建Models文件夹,3个文件的内容如下:
(1)模型的创建

模型的基础类Student.cs:
接口文件,方便直接处理Student相关的数据,后续可方便通过接口这个服务调用数据了,IStudentRepository.cs:
mock数据用,继承接口服务,MockStudentRepository.cs:
(2)服务的注入
- IStudentRepository这个服务的GetStudent()方法,没有写具体的返回值,无法获取到具体的数据。
- 目前IStudentRepository还需要注入下,并指定该服务与哪个类绑定(MockStudentRepository.cs)。


