public static IEnumerable <IAttributeSetInstanceExtensionFieldMvoStateDto> ToAttributeSetInstanceExtensionFieldMvoStateDtoCollection(IEnumerable <AttributeSetInstanceExtensionFieldId> ids) { var states = new List <IAttributeSetInstanceExtensionFieldMvoStateDto>(); foreach (var id in ids) { var dto = new AttributeSetInstanceExtensionFieldMvoStateDtoWrapper(); dto.AttributeSetInstanceExtensionFieldId = new AttributeSetInstanceExtensionFieldIdDtoWrapper(id); states.Add(dto); } return(states); }
public IAttributeSetInstanceExtensionFieldMvoStateDto Get(string id, string fields = null) { try { var idObj = AttributeSetInstanceExtensionFieldMvosControllerUtils.ParseIdString(id); var state = _attributeSetInstanceExtensionFieldMvoApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new AttributeSetInstanceExtensionFieldMvoStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = AttributeSetInstanceExtensionFieldMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }