예제 #1
0
        public static IEnumerable <ILocatorTypeStateDto> ToLocatorTypeStateDtoCollection(IEnumerable <string> ids)
        {
            var states = new List <ILocatorTypeStateDto>();

            foreach (var id in ids)
            {
                var dto = new LocatorTypeStateDtoWrapper();
                dto.LocatorTypeId = id;
                states.Add(dto);
            }
            return(states);
        }
예제 #2
0
 public ILocatorTypeStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = id;
         var state = _locatorTypeApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new LocatorTypeStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = LocatorTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }