public async Task <ActionResult <DTOs.Location> > Create([FromBody] DTOs.Location locationDto) { var location = locationDto.ToLocation(); var createdLoc = await _locationsRepository.CreateAsync(location); return(Created("location", createdLoc.ToLocationDto())); }
public LocPocMutation(ILocationsRepositoryAsync repository, LocationMessageService messageService) { FieldAsync <LocationType>( "createLocation", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <LocationInputType> > { Name = "location" }), resolve: async context => { var location = context.GetArgument <Location>("location"); await repository.CreateAsync(location); messageService.AddLocationAddedMessage(location); return(location); }); }