ABP中mapping中忽略属性

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

 

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

        }
    }

 

posted @ 2018-09-02 22:04  恝置  Views(462)  Comments(0Edit  收藏  举报