Exemple #1
0
        public async Task InsertUserAsync(User item)
        {
            using var db = new EfDataContext(options);
            await db.Users.AddAsync(item);

            await db.SaveChangesAsync().ConfigureAwait(true);
        }
Exemple #2
0
        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);
        }