NewGaoKaoApi/New_College.Extensions/AutoMapper/CustomProfile.cs

19 lines
442 B
C#

using AutoMapper;
using New_College.Model.Models;
using New_College.Model.ViewModels;
namespace New_College.AutoMapper
{
public class CustomProfile : Profile
{
/// <summary>
/// 配置构造函数,用来创建关系映射
/// </summary>
public CustomProfile()
{
CreateMap<BlogArticle, BlogViewModels>();
CreateMap<BlogViewModels, BlogArticle>();
}
}
}