public static async Task SaveObjectsAsync(Phone p) { using (ModelDB db = new ModelDB()) { db.Phones.Add(p); await db.SaveChangesAsync(); } }
public static async Task GetObjectsAsync() { using (ModelDB db = new ModelDB()) { await db.Phones.ForEachAsync(p => { Console.WriteLine("{0}.{1} - {2})", p.Id, p.Name, p.Price); }); } }