Example #1
0
 public async Task ReadPlatesAsync()
 {
     using (CVContext db = new CVContext())
     {
         //Console.WriteLine("9999");
         var plates = await(from c in db.Plates
                            select c).ToListAsync();
         foreach (var c in plates)
         {
             PlatesFromDB.Add(c.Path + " : " + c.Count);
         }
     }
 }
Example #2
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();
     }
 }
Example #3
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();
     }
 }