public static InputControlViewModel MapInputControls(IDataReader reader, int index)
        {
            InputControlViewModel model = new InputControlViewModel();

            model.Title          = reader.GetSafeString(index++);
            model.Description    = reader.GetSafeString(index++);
            model.Version        = reader.GetSafeDecimal(index++);
            model.InputControlId = reader.GetSafeInt32(index++);
            model.Label          = reader.GetSafeString(index++);
            model.Name           = reader.GetSafeString(index++);
            model.Type           = reader.GetSafeString(index++);
            model.ParentId       = reader.GetSafeInt32(index++);
            model.Position       = reader.GetSafeInt32(index++);
            model.DataType       = reader.GetSafeString(index++);
            return(model);
        }
        public List <InputControlViewModel> SelectByFormId(int id)
        {
            List <InputControlViewModel> result = new List <InputControlViewModel>();

            this._dataProvider.ExecuteCmd(
                "InputControls_View",
                inputParamMapper : delegate(SqlParameterCollection paramList)
            {
                paramList.AddWithValue("@FormId", id);
            },
                singleRecordMapper : delegate(IDataReader reader, short set)
            {
                InputControlViewModel model = new InputControlViewModel();
                int index = 0;
                model     = MapInputControls(reader, index);
                index++;
                result.Add(model);
            });
            return(result);
        }