Beispiel #1
0
        public static IEnumerable <UserRoleMvoStateDto> ToUserRoleMvoStateDtoCollection(IEnumerable <UserRoleId> ids)
        {
            var states = new List <UserRoleMvoStateDto>();

            foreach (var id in ids)
            {
                var dto = new UserRoleMvoStateDto();
                dto.UserRoleId = new UserRoleIdDto(id);
                states.Add(dto);
            }
            return(states);
        }
Beispiel #2
0
 public UserRoleMvoStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = UserRoleMvosControllerUtils.ParseIdString(id);
         var state = (UserRoleMvoState)_userRoleMvoApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new UserRoleMvoStateDto(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = UserRoleMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }