Ejemplo n.º 1
0
 public static void AddLeaflet(LeafletModel leafletModel)
 {
     using (SaleFinderDbContext context = new SaleFinderDbContext())
     {
         context.Leaflets.Add(leafletModel);
         context.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public static void InitDatabase()
 {
     using (SaleFinderDbContext context = new SaleFinderDbContext())
     {
         context.Database.Migrate();
         context.SaveChanges();
     }
 }
Ejemplo n.º 3
0
        public static void DeleteLeaflets(string groupName)
        {
            using (SaleFinderDbContext context = new SaleFinderDbContext())
            {
                var leafletsToDelete = context.Leaflets.Where(x => x.GroupName == groupName).ToList();
                context.Leaflets.RemoveRange(leafletsToDelete);

                context.SaveChanges();
            }
        }