Esempio n. 1
0
        public GetLicenses DeleteLicensedUser(GetLicenses obj)
        {
            var returnModel         = new GetLicenses();
            var getLicensedUserList = _userAuthenticationsRepo.GetAll().ToList();
            var userList            = _usersRepo.GetAll().ToList();
            var getUserId           = (from p in getLicensedUserList
                                       join s in userList on p?.UserId equals s?.Id
                                       where p.Id == obj.LicensedId && s.Id == p.UserId
                                       select s).SingleOrDefault();
            var Users = _usersRepo.Get(getUserId.Id);
            var UserAuthentications = _userAuthenticationsRepo.Get(obj.LicensedId);

            if (UserAuthentications != null)
            {
                _userAuthenticationsRepo.Delete(UserAuthentications);

                // returnModel.Message = "Delete Successful.";
            }
            if (Users != null)
            {
                _usersRepo.Delete(Users);

                // returnModel.Message = "Delete Successful.";
            }
            return(returnModel);
        }
Esempio n. 2
0
        // POST: Roles/Delete/5
        public async Task Delete(User user)
        {
            _userRepo.Delete(user);
            await _userRepo.Save();

            //_context.Roles.Remove(role);
            //await _context.SaveChangesAsync();
        }
Esempio n. 3
0
 public IHttpActionResult Delete(int id)
 {
     if (repo.Get(id) != null)
     {
         repo.Delete(id);
         return(StatusCode(HttpStatusCode.NoContent));
     }
     else
     {
         return(StatusCode(HttpStatusCode.NotFound));
     }
 }
Esempio n. 4
0
 public IActionResult Delete([FromRoute] int id)
 {
     _users.Delete(id);
     return(Ok());
 }