예제 #1
0
        public async Task <int> DeleteUser(string id)
        {
            var user = (from i in db.Users
                        where i.userID == id
                        select i).FirstOrDefault();

            db.Remove(user);
            return(await db.SaveChangesAsync());
        }
        public async Task <IActionResult> Delete(int id)
        {
            var spentItem = _context.Wallet.FindAsync(id);

            if (spentItem == null)
            {
                _logger.LogInformation($"Daily Expense for {id} does not exists!!");
                return(NotFound());
            }
            _context.Remove(spentItem);
            await SaveAsync();

            return(NoContent());
        }