Exemplo n.º 1
0
        public GetRolesResponse Get(GetRolesRequest request)
        {
            request.Data.SetDefaultOrder("Name");

            var listResponse = repository
                .AsQueryable<Models.Role>()
                .Select(role => new RoleModel
                    {
                        Id = role.Id,
                        Version = role.Version,
                        CreatedBy = role.CreatedByUser,
                        CreatedOn = role.CreatedOn,
                        LastModifiedBy = role.ModifiedByUser,
                        LastModifiedOn = role.ModifiedOn,

                        Name = role.Name,
                        IsSystematic = role.IsSystematic
                    })
                .ToDataListResponse(request);

            return new GetRolesResponse { Data = listResponse };
        }
Exemplo n.º 2
0
 public GetRolesResponse Get(GetRolesRequest request)
 {
     throw new CmsException(UsersApiConstants.UsersApiHasNoImplementationMessage);
 }
Exemplo n.º 3
0
        public GetRolesResponse Post(GetRolesRequest request)
        {
            _log.StartLog(request);
            try
            {

                var roles = _authProvider.GetRoles(this.GetSession().UserAuthName);
                return new GetRolesResponse {Roles = roles.ToList()};
            }
            catch (Exception e)
            {
                _log.Fatal("error", e);
                Errors.Add(e.Message + " " + e.StackTrace);
                return new GetRolesResponse {Errors = Errors};
            }
        }
Exemplo n.º 4
0
 /// <remarks/>
 public void GetRolesAsync(GetRolesRequest GetRolesRequest, object userState)
 {
     if ((this.GetRolesOperationCompleted == null)) {
         this.GetRolesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRolesOperationCompleted);
     }
     this.InvokeAsync("GetRoles", new object[] {
                 GetRolesRequest}, this.GetRolesOperationCompleted, userState);
 }
Exemplo n.º 5
0
 /// <remarks/>
 public void GetRolesAsync(GetRolesRequest GetRolesRequest)
 {
     this.GetRolesAsync(GetRolesRequest, null);
 }
Exemplo n.º 6
0
 /// <remarks/>
 public System.IAsyncResult BeginGetRoles(GetRolesRequest GetRolesRequest, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("GetRoles", new object[] {
                 GetRolesRequest}, callback, asyncState);
 }