public override async Task <OcelotDto> CreateAsync(OcelotCreateDto input) { var ocelot = await OcelotManager.CreateAsync(input.Name); await OcelotRepository.InsertAsync(ocelot); return(ObjectMapper.Map <Ocelot, OcelotDto>(ocelot)); }
public override async Task <OcelotDto> UpdateAsync(Guid id, OcelotUpdateDto input) { var entity = await GetEntityByIdAsync(id).ConfigureAwait(false); MapToEntity(input, entity); await OcelotRepository.UpdateAsync(entity).ConfigureAwait(false); return(MapToGetOutputDto(entity)); }
public virtual async Task <IList <OcelotReRouteDto> > UpdateReRoutesAsync(Guid id, List <OcelotReRouteDto> input) { var entity = await OcelotRepository.GetAsync(id).ConfigureAwait(false); ObjectMapper.Map(input, entity.ReRoutes); await OcelotRepository.UpdateAsync(entity, true).ConfigureAwait(false); return(ObjectMapper.Map <IList <OcelotReRoute>, IList <OcelotReRouteDto> >(entity.ReRoutes)); }
public virtual async Task <List <OcelotRouteDto> > UpdateRoutesAsync(Guid id, List <OcelotRouteDto> input) { var ocelot = await OcelotRepository.GetAsync(id).ConfigureAwait(false); UpdateOcelotRoute(input, ocelot); await OcelotRepository.UpdateAsync(ocelot, true).ConfigureAwait(false); return(ObjectMapper.Map <List <OcelotRoute>, List <OcelotRouteDto> >(ocelot.Routes)); }
public virtual async Task <IList <OcelotReRouteDto> > GetReRoutesAsync(Guid id) { var reRoutes = await OcelotRepository.GetReRoutesAsync(id); return(ObjectMapper.Map <IList <OcelotReRoute>, IList <OcelotReRouteDto> >(reRoutes)); }
public virtual async Task <OcelotWithDetailsDto> FindByNameAsync(string name) { var config = await OcelotRepository.FindByNameAsync(name); return(ObjectMapper.Map <Ocelot, OcelotWithDetailsDto>(config)); }
public override async Task <OcelotDto> GetAsync(Guid id) { var entity = await OcelotRepository.GetAsync(id).ConfigureAwait(false); return(ObjectMapper.Map <Ocelot, OcelotDto>(entity)); }