diff options
Diffstat (limited to 'Models/MyDarlingRepository.cs')
-rw-r--r-- | Models/MyDarlingRepository.cs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/Models/MyDarlingRepository.cs b/Models/MyDarlingRepository.cs deleted file mode 100644 index 15f058c..0000000 --- a/Models/MyDarlingRepository.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace MyDarling.Models -{ - public class MyDarlingRepository : IRepository - { - private DataContext DbContext { get; } - public MyDarlingRepository(IServiceProvider provider) - { - DbContext = provider.CreateScope().ServiceProvider.GetRequiredService<DataContext>(); - } - - public IQueryable<UnderwearBundle> Bundles => DbContext.UnderwearBundles.Include(b => b.Figures); - - public void Add(UnderwearBundle b) - { - DbContext.UnderwearBundles.Add(b); - DbContext.SaveChanges(); - } - - public void Remove(UnderwearBundle b) - { - DbContext.UnderwearBundles.Remove(b); - DbContext.SaveChanges(); - } - - public void Save() - { - DbContext.SaveChanges(); - } - } -}
\ No newline at end of file |