public static IEnumerable <IRoleTypeStateDto> ToRoleTypeStateDtoCollection(IEnumerable <string> ids) { var states = new List <IRoleTypeStateDto>(); foreach (var id in ids) { var dto = new RoleTypeStateDtoWrapper(); dto.RoleTypeId = id; states.Add(dto); } return(states); }
public IRoleTypeStateDto Get(string id, string fields = null) { try { var idObj = id; var state = _roleTypeApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new RoleTypeStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }