naming
This commit is contained in:
@@ -9,37 +9,37 @@ using Webshop.Infrastructure.Data;
|
||||
|
||||
namespace Webshop.Infrastructure.Repositories
|
||||
{
|
||||
public class categorieRepository : IcategorieRepository
|
||||
public class CategorieRepository : ICategorieRepository
|
||||
{
|
||||
private readonly ApplicationDbContext _context;
|
||||
|
||||
public categorieRepository(ApplicationDbContext context)
|
||||
public CategorieRepository(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<categorie>> GetAllAsync()
|
||||
public async Task<IEnumerable<Categorie>> GetAllAsync()
|
||||
{
|
||||
return await _context.categories.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<categorie?> GetByIdAsync(Guid id)
|
||||
public async Task<Categorie?> GetByIdAsync(Guid id)
|
||||
{
|
||||
return await _context.categories.FindAsync(id);
|
||||
}
|
||||
|
||||
public async Task<categorie?> GetBySlugAsync(string slug)
|
||||
public async Task<Categorie?> GetBySlugAsync(string slug)
|
||||
{
|
||||
return await _context.categories.FirstOrDefaultAsync(c => c.Slug == slug);
|
||||
}
|
||||
|
||||
public async Task AddAsync(categorie categorie)
|
||||
public async Task AddAsync(Categorie categorie)
|
||||
{
|
||||
_context.categories.Add(categorie);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateAsync(categorie categorie)
|
||||
public async Task UpdateAsync(Categorie categorie)
|
||||
{
|
||||
_context.categories.Update(categorie);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user