Created
January 28, 2019 12:11
-
-
Save evgomes/f2138c526b717ec3d66d2a58f3dffe85 to your computer and use it in GitHub Desktop.
Initial code of CategoryRepository, from 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 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