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.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
using Grand.Business.Core.Interfaces.Common.Directory;
using Grand.Domain.Orders;
using Grand.Infrastructure.Mapper;
using Grand.Web.AdminShared.Models.Orders;
using Grand.Web.Common.Extensions;
namespace Grand.Web.AdminShared.Extensions.Mapping;
public static class GiftVoucherMappingExtensions
{
public static GiftVoucherModel ToModel(this GiftVoucher entity, IDateTimeService dateTimeService)
{
var giftVoucher = entity.MapTo<GiftVoucher, GiftVoucherModel>();
giftVoucher.ValidTo = entity.ValidTo.ConvertToUserTime(dateTimeService);
return giftVoucher;
}
public static GiftVoucher ToEntity(this GiftVoucherModel model, IDateTimeService dateTimeService)
{
var giftVoucher = model.MapTo<GiftVoucherModel, GiftVoucher>();
giftVoucher.ValidTo = model.ValidTo.ConvertToUtcTime(dateTimeService);
return giftVoucher;
}
public static GiftVoucher ToEntity(this GiftVoucherModel model, GiftVoucher destination,
IDateTimeService dateTimeService)
{
var giftVoucher = model.MapTo(destination);
giftVoucher.ValidTo = model.ValidTo.ConvertToUtcTime(dateTimeService);
return giftVoucher;
}
}