Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }