public IHttpActionResult Get(int id, int?DefinitionSourceId = null, int?ControlSetClassificationId = null)
        {
            #region Preconditions

            if (controlSetRepository == null)
            {
                throw new InvalidOperationException();
            }

            if (id <= 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            #endregion

            try
            {
                var controlSet = ((ControlSetRepository)controlSetRepository).GetItem(id, DefinitionSourceId, ControlSetClassificationId);

                var dtoControlSet = ControlSetMapper.TranslateModelControlSetToDTOControlSet(controlSet);

                return(Ok(dtoControlSet));
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }
        public static Model.WorkingSetTemplate TranslateDTOWorkingTemplateSetToModelWorkingSetTemplate(DTO.WorkingSetTemplate wst)
        {
            if (wst == null)
            {
                return(null);
            }

            return(new Model.WorkingSetTemplate
            {
                ControlSets = ControlSetMapper.TranslateDTOControlSetListToModelControlSetList(wst.ControlSets),
                Created = wst.Created,
                CreatedByUserId = wst.CreatedByUserId,
                CreatedByUserName = wst.CreatedByUserName,
                Name = wst.Name,
                WorkingSetTemplateGuid = wst.WorkingSetTemplateGuid,
                WorkingSetTemplateId = wst.WorkingSetTemplateId
            });
        }
        public IHttpActionResult Get()
        {
            #region Preconditions

            if (controlSetRepository == null)
            {
                throw new InvalidOperationException();
            }

            #endregion

            try
            {
                var controlSets = controlSetRepository.GetItems();

                var dtoControlSets = controlSets.Select(cs => ControlSetMapper.TranslateModelControlSetToDTOControlSet(cs));

                return(Ok(dtoControlSets));
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }