Skip to content

Instantly share code, notes, and snippets.

@evgomes
Created January 25, 2019 17:04
Show Gist options
  • Save evgomes/d41c9ebe891cfb29f920a418aa1501aa to your computer and use it in GitHub Desktop.
Save evgomes/d41c9ebe891cfb29f920a418aa1501aa to your computer and use it in GitHub Desktop.
CategoryService after creating ICategoryRepository interface, of Supermarket API.
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