예제 #1
0
        public void Delete(Guid Id)
        {
            var id   = _context.UserRoles.First(x => x.UserId == Id).RoleId;
            var role = _context.Roles.First(x => x.Id == id);

            if (role.Name == "Client")
            {
                _context.Remove(GetById(Id));
                _context.SaveChanges();
            }
        }
예제 #2
0
 public void Delete(Guid Id)
 {
     if (_info.Role == "Client")
     {
         var userid = _requestcontext.Requests.First(x => x.Id == Id).UserId;
         if (userid.ToString() == _info.Id)
         {
             _requestcontext.Remove(GetRequestById(Id));
             _requestcontext.SaveChanges();
         }
     }
     else
     {
         _requestcontext.Remove(GetRequestById(Id));
         _requestcontext.SaveChanges();
     }
 }
예제 #3
0
 public void Delete(Guid Id)
 {
     _profilecontext.Remove(GetProfileById(Id));
     _profilecontext.SaveChanges();
 }