private async Task <IEnumerable <CarTrademarkModel> > ResolveAsync(CarWorkshopDto source) { var trademarks = source.GetTrademarks(); var carTrademarkModels = new List <CarTrademarkModel>(); foreach (var trademark in trademarks) { var carTrademarkModel = _carTrademarksRepository.Resolve(o => o.Trademark.ToLower() == trademark.ToLower()); if (carTrademarkModel == null) { carTrademarkModel = new CarTrademarkModel { Trademark = trademark }; await _carTrademarksRepository.AddAsync(carTrademarkModel); } carTrademarkModels.Add(carTrademarkModel); } return(carTrademarkModels); }
public CarTrademarkModel Resolve(AppointmentDto source, AppointmentModel destination, CarTrademarkModel destMember, ResolutionContext context) { return(_carTrademarksRepository.Resolve(o => o.Trademark == source.UserCarTrademark)); }