public async Task InsertUserAsync(User item) { using var db = new EfDataContext(options); await db.Users.AddAsync(item); await db.SaveChangesAsync().ConfigureAwait(true); }
public async Task DeleteUserAsync(string username) { using var db = new EfDataContext(options); var item = await db.Users.FindAsync(username); db.Users.Remove(item); await db.SaveChangesAsync().ConfigureAwait(true); }
public async Task <User> GetUserAsync(string username) { using var db = new EfDataContext(options); return(await db.Users.FindAsync(username).ConfigureAwait(true)); }
public async Task <List <User> > GetUsersListAsync() { using var db = new EfDataContext(options); return(await db.Users.ToListAsync().ConfigureAwait(true)); }