public async Task <ActionResult <GuidDataResponse> > CreateGuidData(GuidDataRequest request) { GuidDataRequestValidator.EnsureValid(request); var response = await _provider.CreateGuidData(request); return(Created($"{UriHelper.GetEncodedUrl(Request)}/{response.Guid}", response)); }
public async Task <ActionResult <GuidDataResponse> > UpsertGuidData(string guid, GuidDataRequest request) { GuidValidator.EnsureValid(guid); GuidDataRequestValidator.EnsureValid(request); var(response, isUpdated) = await _provider.UpsertGuidData(guid, request); if (isUpdated) { return(Ok(response)); } else { return(Created(UriHelper.GetEncodedUrl(Request), response)); } }