public void SubmitForm(TagsEntity tagsEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { tagsEntity.Modify(keyValue); service.Update(tagsEntity); } else { tagsEntity.Create(); service.Insert(tagsEntity); } }
public async Task <TagsResponse> UpdateAsync(int id, Tags tags) { var existingTags = await _tagsRepository.FindByIdAsync(id); if (existingTags == null) { return(new TagsResponse("tags not found.")); } existingTags.Name = tags.Name; try { _tagsRepository.Update(existingTags); await _unitOfWork.CompleteAsync(); return(new TagsResponse(existingTags)); } catch (Exception ex) { // Do some logging stuff return(new TagsResponse($"An error occurred when updating the tags: {ex.Message}")); } }
public async Task <bool> Update(Tags tag) { return(await _tagsRepository.Update(tag)); }
public TagModel UpdateTag(TagModel model) { var updated = _repo.Update(model); return(GetTag(updated.Id)); }
public void Update(TagsViewModel obj) { var tag = _mapper.Map <Tags>(obj); _tagsRepository.Update(tag); }