public void UpdateEntry([FromBody] UpdateEntryRequest updateEntryRequest) { try { _diaryRepository.Update(updateEntryRequest); } catch (InvalidOperationException) { throw new HttpResponseException(HttpStatusCode.NotFound); } }
/// <summary> /// Update a blog entry. /// </summary> /// <remarks> /// Sample request: /// /// POST /Create /// { /// "Title": "Blog title or subject", /// "Content": { /// "Html": "Some html content" /// } /// } /// /// </remarks> /// <param name="updateEntryModel"></param> /// <returns><see cref="OkResult"/></returns> /// <response code="200">Returns ok result</response> /// <response code="400">If the information is not valid</response> public async Task <IActionResult> Update([FromBody] UpdateEntryRequest updateEntryModel) { if (!ModelState.IsValid) { return(ValidationProblem()); } await Mediator.Send(updateEntryModel).ConfigureAwait(false); return(Ok()); }
/// <summary>Snippet for UpdateEntry</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void UpdateEntryRequestObject() { // Create client DataCatalogClient dataCatalogClient = DataCatalogClient.Create(); // Initialize request argument(s) UpdateEntryRequest request = new UpdateEntryRequest { Entry = new Entry(), UpdateMask = new FieldMask(), }; // Make the request Entry response = dataCatalogClient.UpdateEntry(request); }
/// <summary>Snippet for UpdateEntryAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task UpdateEntryRequestObjectAsync() { // Create client DataCatalogClient dataCatalogClient = await DataCatalogClient.CreateAsync(); // Initialize request argument(s) UpdateEntryRequest request = new UpdateEntryRequest { Entry = new Entry(), UpdateMask = new FieldMask(), }; // Make the request Entry response = await dataCatalogClient.UpdateEntryAsync(request); }