Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

MapperConfiguration.cs

using AutoMapper;
using Nop.Core.Infrastructure.Mapper;
using Nop.Plugin.Widgets.AccessiBe.Models;

namespace Nop.Plugin.Widgets.AccessiBe.Infrastructure;

/// 
/// Represents AutoMapper configuration for widget models
/// 
public class MapperConfiguration : Profile, IOrderedMapperProfile
{
    #region Ctor

    public MapperConfiguration()
    {
        CreateMap();
        CreateMap();

        CreateMap()
            .ForMember(model => model.ShowMobile, options => options.MapFrom(src => !src.HideMobile)); //invert
        CreateMap()
            .ForMember(setting => setting.HideMobile, options => options.MapFrom(src => !src.ShowMobile)); //invert
    }

    #endregion

    #region Properties

    /// 
    /// Order of this mapper implementation
    /// 
    public int Order => 1;

    #endregion
}