public async Task <(int ResultAction, TagResponse AddedEntity)> AddTagAsync(TagRequest tag) { if (tag == null) { return(-1, null); } var addTag = new Tag() { Name = tag.Name, Visible = tag.Visible }; var result = await _tagBaseServices.InsertAsync(addTag).ConfigureAwait(false); return(result.ResultAction, new TagResponse { TagID = result.AddedEntity.Id, Name = result.AddedEntity.Name }); }
public async Task <(int ResultAction, CategoryResponse AddedEntity)> AddCategoryAsync(CategoryRequest category) { if (category == null) { return(-1, null); } var addCategory = new Category() { Name = category.Name, Visible = category.Visible }; var result = await _categoryBaseServices.InsertAsync(addCategory).ConfigureAwait(false); return(result.ResultAction, new CategoryResponse { CatID = result.AddedEntity.Id, Name = result.AddedEntity.Name }); }