Пример #1
0
 public async Task WritePlatesAsync(Dictionary <string, int> dict)
 {
     using (CVContext db = new CVContext())
     {
         foreach (KeyValuePair <string, int> item in dict)
         {
             PlateNumber plateNumber = new PlateNumber();
             plateNumber.Path  = item.Key;
             plateNumber.Count = item.Value;
             db.Plates.Add(plateNumber);
         }
         //Console.WriteLine("88888");
         await db.SaveChangesAsync();
     }
 }
Пример #2
0
 public async Task WriteCatsAsync(Dictionary <string, int> dict)
 {
     using (CVContext db = new CVContext())
     {
         foreach (KeyValuePair <string, int> item in dict)
         {
             Cat cat = new Cat();
             cat.Path  = item.Key;
             cat.Count = item.Value;
             db.Cats.Add(cat);
         }
         //Console.WriteLine("88888");
         await db.SaveChangesAsync();
     }
 }