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.

1.3 KB
Raw Blame
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
using Grand.Web.AdminShared.Models.Orders;

namespace Grand.Web.AdminShared.Extensions.Mapping;

public static class CheckoutAttributeMappingExtensions
{
    //attributes
    public static CheckoutAttributeModel ToModel(this CheckoutAttribute entity)
    {
        return entity.MapTo<CheckoutAttribute, CheckoutAttributeModel>();
    }

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

    public static CheckoutAttribute ToEntity(this CheckoutAttributeModel model, CheckoutAttribute destination)
    {
        return model.MapTo(destination);
    }

    //checkout attribute value
    public static CheckoutAttributeValueModel ToModel(this CheckoutAttributeValue entity)
    {
        return entity.MapTo<CheckoutAttributeValue, CheckoutAttributeValueModel>();
    }

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

    public static CheckoutAttributeValue ToEntity(this CheckoutAttributeValueModel model,
        CheckoutAttributeValue destination)
    {
        return model.MapTo(destination);
    }
}