Skip to content

Instantly share code, notes, and snippets.

@evgomes
Created January 28, 2019 12:11
Show Gist options
  • Save evgomes/f2138c526b717ec3d66d2a58f3dffe85 to your computer and use it in GitHub Desktop.
Save evgomes/f2138c526b717ec3d66d2a58f3dffe85 to your computer and use it in GitHub Desktop.
Initial code of CategoryRepository, from Supermarket API
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Supermarket.API.Domain.Models;
using Supermarket.API.Domain.Repositories;
using Supermarket.API.Persistence.Contexts;
namespace Supermarket.API.Persistence.Repositories
{
public class CategoryRepository : BaseRepository, ICategoryRepository
{
public CategoryRepository(AppDbContext context) : base(context)
{
}
public async Task<IEnumerable<Category>> ListAsync()
{
return await _context.Categories.ToListAsync();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment