Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

573 B
Raw Blame
using Grand.Domain.Stores;
using Grand.Infrastructure.Mapper;
using Grand.Web.AdminShared.Models.Stores;

namespace Grand.Web.AdminShared.Extensions.Mapping;

public static class StoreMappingExtensions
{
    public static StoreModel ToModel(this Store entity)
    {
        return entity.MapTo<Store, StoreModel>();
    }

    public static Store ToEntity(this StoreModel model)
    {
        return model.MapTo<StoreModel, Store>();
    }

    public static Store ToEntity(this StoreModel model, Store destination)
    {
        return model.MapTo(destination);
    }
}