/// <summary> /// Creates the persistent storage if it does not exist yet. /// </summary> /// <returns>A Task that will complete when the storage has been created.</returns> public async Task EnsureCreated() { using (var context = new SunflowerDbContext()) { await context.Database.EnsureCreatedAsync(); } }
/// <summary> /// Creates an EntityRepository that uses an Entity Framework context. /// </summary> /// <param name="db">Entity Framework context used to make changes.</param> public EntityRepository(SunflowerDbContext db) { _db = db; }
/// <summary> /// Creates an EntityQueryCollection that proxies an Entity Framework context. /// </summary> /// <param name="db">Entity Framework context to use for accessing the queryables.</param> public EntityQueryCollection(SunflowerDbContext db) { _db = db; }