public async Task <CategoryOutputDto> GetByName(string name) { var model = await this.categories.GetByNameAsync(name); var result = new CategoryOutputDto { Id = model.Id, CategoryName = model.CategoryName }; return(result); }
public async Task <CategoryOutputDto> CreateAsync() { var model = new Category { CategoryName = DateTime.Now.ToString() }; await this.categories.InsertAsync(model); var result = new CategoryOutputDto { Id = model.Id, CategoryName = model.CategoryName }; return(result); }