.Net Core Mvc中使用AutoMapper
type
status
date
slug
summary
tags
category
icon
password
order
最近在学习.Net Core,于是也了解到了AutoMapper。
首先要 nuget添加下AutoMapper 我这次装的版本号是6.10的。
第一种方法 是想在Controller中使用的
1.新建个配置类 以便之后初始化AutoMapper
2.在Startup.cs中加一个属性
3.在Start方法中增加
4.在ConfigureServices方法中增加
5.就可以在Controller中使用了
第二种方法 在Service中使用