コード例 #1
0
        public async Task <ActionResult> DeleteConfirmed([FromBody] string toDelete)
        {
            var loginViewModel = await db.Users.FirstOrDefaultAsync(x => x.Id.ToString() == toDelete);

            if (loginViewModel == null)
            {
                return(NotFound());
            }
            db.Delete(loginViewModel);
            db.SaveChanges();
            return(Ok());
        }