Created
January 30, 2019 15:41
-
-
Save evgomes/d0ea98d8a16b5b2a4b7fe35ac6b6549a to your computer and use it in GitHub Desktop.
CategoryRepository with AddAsync method, 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
public class CategoryRepository : BaseRepository, ICategoryRepository | |
{ | |
public CategoryRepository(AppDbContext context) : base(context) | |
{ } | |
public async Task<IEnumerable<Category>> ListAsync() | |
{ | |
return await _context.Categories.ToListAsync(); | |
} | |
public async Task AddAsync(Category category) | |
{ | |
await _context.Categories.AddAsync(category); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment