BExIS.Web.Shell.Areas.DIM.Controllers.DataController.Get C# (CSharp) Метод

Get() публичный Метод

In addition to the id, it is possible to have projection and selection criteria passed to the action via query string parameters
The action accepts the following additional parameters via the query string 1: projection: is a comman separated list of ids that determines which variables of the dataset version tuples should take part in the result set 2: selection: is a logical expression that filters the tuples of the chosen dataset. The expression should have been written against the variables of the dataset only. logical operators, nesting, precedence, and SOME functions should be supported.
public Get ( int id ) : HttpResponseMessage
id int Dataset Id
Результат System.Net.Http.HttpResponseMessage
        public HttpResponseMessage Get(int id)
        {
            string projection = this.Request.GetQueryNameValuePairs().FirstOrDefault(p => "header".Equals(p.Key, StringComparison.InvariantCultureIgnoreCase)).Value;
            string selection  = this.Request.GetQueryNameValuePairs().FirstOrDefault(p => "filter" .Equals(p.Key, StringComparison.InvariantCultureIgnoreCase)).Value;

            OutputDataManager ioOutputDataManager = new OutputDataManager();

            DatasetManager dm = new DatasetManager();
            DatasetVersion version = dm.GetDatasetLatestVersion(id);

            string title = XmlDatasetHelper.GetInformation(version, NameAttributeValues.title);

            // check the data sturcture type ...
            if (version.Dataset.DataStructure.Self is StructuredDataStructure)
            {
                // apply selection and projection
                //var tuples = dm.GetDatasetVersionEffectiveTuples(version);
                DataTable dt = OutputDataManager.ConvertPrimaryDataToDatatable(dm, version, title, true);

                if (!string.IsNullOrEmpty(selection))
                {
                    dt = OutputDataManager.SelectionOnDataTable(dt, selection);
                }

                if (!string.IsNullOrEmpty(projection))
                {
                    // make the header names upper case to make them case insensitive
                    dt = OutputDataManager.ProjectionOnDataTable(dt, projection.ToUpper().Split(','));
                }

                DatasetModel model = new DatasetModel();
                model.DataTable = dt;

                var response = Request.CreateResponse();
                response.Content = new ObjectContent(typeof(DatasetModel), model, new DatasetModelCsvFormatter(model.DataTable.TableName));

                //set headers on the "response"
                return response;

                //return model;

            } else
            {
                return Request.CreateResponse();
            }
        }

Same methods

DataController::Get ( ) : IEnumerable