Пример #1
0
        public PagedList <ResponseAuthModelDTO> GetAuthList(RequestAuthModelQDTO request)
        {
            using (var db = new DBEntities())
            {
                var query = from auth in db.AuthModels.Where(t => t.Type == request.Type)
                            join automap in db.AuthRoleMaps.Where(t => t.RoleID == request.ID) on auth.AuthID equals automap.AuthID into automapLeft
                            from automapEmpty in automapLeft.DefaultIfEmpty()
                            select new ResponseAuthModelDTO()
                {
                    AuthID   = auth.AuthID,
                    AuthName = auth.AuthName,
                    Selected = automapEmpty != null
                };

                query = query.OrderBy(t => t.AuthID);

                return(query.ToPagedList(request.PageIndex, request.PageSize));
            }
        }
Пример #2
0
 public ApiResult GetAuthList([FromBody] RequestAuthModelQDTO request)
 {
     return(userService.GetAuthList(request).ToApiResult());
 }