protected override async Task Apply(TradingChannelServiceModel source, TradingChannel target) { if (source == null) { return; } // Do Additional saving things here }
public async Task <IActionResult> SaveTradingChannel([FromBody] TradingChannelServiceModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } return(Ok(await Mediator.Send(new SaveTradingChannelRequest() { ServiceModel = model }))); }
public override void MapMore(TradingChannel source, TradingChannelServiceModel target) { target.Uri = $"http://localhost:5000/api/{_userContext.GetCompanyId()}/AS2"; // Additional Mappings ... }
public static TradingChannelServiceModel MapTradingChannel(this IMapperService mapper, TradingChannel model, TradingChannelServiceModel serviceModel = null) { serviceModel = serviceModel ?? new TradingChannelServiceModel(); mapper.MapTo <TradingChannel, TradingChannelServiceModel>(model, serviceModel); return(serviceModel); }