ABP中mapping中忽略属性

时间:2018-09-02 22:37:23   收藏:0   阅读:431

创建一个XXXXProfile继承Profile,然后在构造函数中写忽略相关的,如下

 

public class ProductPriceDtoProfile: Profile
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public ProductPriceDtoProfile()
        {
            CreateMap<ProductInfo, ProductPriceDto>().ForMember(x => x.SalePrice, opt => opt.Ignore());

        }
    }

 

原文:https://www.cnblogs.com/albertay/p/9575667.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!