Created
January 25, 2019 17:04
-
-
Save evgomes/d41c9ebe891cfb29f920a418aa1501aa to your computer and use it in GitHub Desktop.
CategoryService after creating ICategoryRepository interface, of Supermarket API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Supermarket.API.Domain.Models; | |
using Supermarket.API.Domain.Repositories; | |
using Supermarket.API.Domain.Services; | |
namespace Supermarket.API.Services | |
{ | |
public class CategoryService : ICategoryService | |
{ | |
private readonly ICategoryRepository _categoryRepository; | |
public CategoryService(ICategoryRepository categoryRepository) | |
{ | |
this._categoryRepository = categoryRepository; | |
} | |
public async Task<IEnumerable<Category>> ListAsync() | |
{ | |
return await _categoryRepository.ListAsync(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment