protected override async Task Apply(EdiTenderServiceModel source, EdiTender target) { if (source == null) { return; } source.Stops = target.Stops; // Do Additional saving things here }
public virtual async Task OnMap(EdiTender model, EdiTenderServiceModel serviceModel) { }
public static EdiTenderServiceModel MapEdiTender(this IMapperService mapper, EdiTender model, EdiTenderServiceModel serviceModel = null, int fidelity = 1) { serviceModel = serviceModel ?? new EdiTenderServiceModel(); mapper.MapTo <EdiTender, EdiTenderServiceModel>(model, serviceModel, fidelity); return(serviceModel); }
protected override async Task Handle(DenyRequest request, EdiTender model) { model.Status = EdiStatus.Denied; }
protected abstract Task Handle(DenyRequest request, EdiTender model);
protected override async Task Handle(AcceptRequest request, EdiTender model) { }
public override void MapMore(EdiTender source, EdiTenderServiceModel target) { target.Stops = source.Stops; // Additional Mappings ... }
public virtual async Task <EdiTenderServiceModel> Handle(SaveEdiTenderRequest request, CancellationToken cancellationToken) { EdiTender target = null; target = await FindExisting(request.ServiceModel) ?? new EdiTender(); if (target == null) { throw new Exception("Could not save the shipment with that id. It was not found."); } var source = request.ServiceModel; target.Id = source.Id; target.ControlNumber = source.ControlNumber; target.Scac = source.Scac; target.BillOfLading = source.BillOfLading; target.ShipmentOwnerId = source.ShipmentOwnerId; target.LoadTenderType = source.LoadTenderType; target.MethodOfPayment = source.MethodOfPayment; target.TenderDateTime = source.TenderDateTime; target.TotalWeight = source.TotalWeight; target.TotalQuantity = source.TotalQuantity; target.TotalCharges = source.TotalCharges; target.Notes = source.Notes; target.EquipmentNumber = source.EquipmentNumber; target.ReferenceInfo = source.ReferenceInfo; target.EntityCode = source.EntityCode; target.EntityName = source.EntityName; target.LocationCode = source.LocationCode; target.EdiDocument = source.EdiDocument; target.Status = source.Status; target.ShipmentId = source.ShipmentId; await Apply(request.ServiceModel, target); // Save it await Repo.Save(target); return(this.Mapper?.MapTo <EdiTender, EdiTenderServiceModel>(target)); }
protected virtual async Task Apply(EdiTenderServiceModel source, EdiTender target) { }
protected abstract Task Handle(AcceptRequest request, EdiTender model);