BExIS.Dlm.Services.Data.DatasetManager.CreateVariableValue C# (CSharp) Метод

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

This method creates a variable value and returns it without persisting the object in the database. Usually the returned variable value should be added to a data tuple which in turn is belonging to a data set version. A value is a compound object holding information about a single event (sampling). The event can be a(n) measurement, observation, estimation, simulation, or computation of a feature of an entity. The value can be a assigned to a variable or a parameter based on the design of the data structure.
public CreateVariableValue ( string value, string note, System.DateTime samplingTime, System.DateTime resultTime, ObtainingMethod obtainingMethod, System.Int64 variableId, ICollection parameterValues ) : VariableValue
value string The result of the event which can be a(n) measurement, observation, estimation, simulation, or computation
note string A free format, but short, description about the value
samplingTime System.DateTime The exact time of the start of the event. It shows when the sampling is started.
resultTime System.DateTime The sampling, or the processing may take time (like in the computation or simulation cases), also some devices/ sensors have a response time. The parameter captures the time when the result (value) is ready. /// The result time and its difference to sampling time are important for some analyses. ///
obtainingMethod BExIS.Dlm.Entities.DataStructure.ObtainingMethod Determines how the values is obtained, which is one of the measurement, observation, estimation, simulation, or computation cases.
variableId System.Int64 The identifier of the variable that the value is belonging to.
parameterValues ICollection If the variable has parameters attached, the parameter values are passed alongside, so that the method links them to their corresponding variable value using .
Результат BExIS.Dlm.Entities.Data.VariableValue
        public VariableValue CreateVariableValue(string value, string note, DateTime samplingTime, DateTime resultTime, ObtainingMethod obtainingMethod, Int64 variableId, ICollection<ParameterValue> parameterValues)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(value));
            Contract.Requires(variableId > 0);
            Contract.Ensures(Contract.Result<VariableValue>() != null);

            VariableValue e = new VariableValue()
            {
                Value = value,
                Note = note,
                SamplingTime = samplingTime,
                ResultTime = resultTime,
                ObtainingMethod = obtainingMethod,
                VariableId = variableId,
                ParameterValues = new List<ParameterValue>(parameterValues),
            };

            //using (IUnitOfWork uow = this.GetUnitOfWork())
            //{
            //    IRepository<VariableValue> repo = uow.GetRepository<VariableValue>();
            //    repo.Put(e);
            //    uow.Commit();
            //}
            return (e);
        }