public Result<ICollection<RoleDto>> GetRoles(string username)
        {
            Result<ICollection<RoleDto>> retResult = Result<ICollection<RoleDto>>.Undefined(null);
              try
              {
            var roles = GetRolesImpl(username);
            retResult = Result<ICollection<RoleDto>>.Success(roles);
              }
              catch (Exception ex)
              {
            var wrappedEx = new Exceptions.GetRolesFailedException(ex, username);
            retResult = Result<ICollection<RoleDto>>.FailureWithInfo(null, wrappedEx);
              }

              return retResult;
        }
Esempio n. 2
0
    public Result<ICollection<RoleDto>> GetRoles(string username)
    {
      Result<ICollection<RoleDto>> retResult = Result<ICollection<RoleDto>>.Undefined(null);
      try
      {
        //Common.CommonHelper.CheckAuthentication();
        DalHelper.CheckAuthorizationMustRunOnServer();

        var roles = GetRolesImpl(username);
        retResult = Result<ICollection<RoleDto>>.Success(roles);
      }
      catch (Exception ex)
      {
        var wrappedEx = new Exceptions.GetRolesFailedException(ex, username);
        retResult = Result<ICollection<RoleDto>>.FailureWithInfo(null, wrappedEx);
      }

      return retResult;
    }
Esempio n. 3
0
        public Result <ICollection <RoleDto> > GetRoles(string username)
        {
            Result <ICollection <RoleDto> > retResult = Result <ICollection <RoleDto> > .Undefined(null);

            try
            {
                //Common.CommonHelper.CheckAuthentication();
                DalHelper.CheckAuthorizationMustRunOnServer();

                var roles = GetRolesImpl(username);
                retResult = Result <ICollection <RoleDto> > .Success(roles);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.GetRolesFailedException(ex, username);
                retResult = Result <ICollection <RoleDto> > .FailureWithInfo(null, wrappedEx);
            }

            return(retResult);
        }