public async Task <IActionResult> Add([FromBody] MetadataValueViewModel model) { try { model.Id = new Guid(); model.IsActivated = true; await _metadataValueService.CreateAsync(model); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult> Update([FromBody] MetadataValueViewModel model) { try { var model_db = await _metadataValueService.FindByIdAsync(model.Id); if (model_db == null) { return(BadRequest("Model is not exists")); } model_db = model; await _metadataValueService.UpdateAsync(model_db, model_db.Id); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }