TransactionalNodeService.MapParameter.LoadSessionObject C# (CSharp) Method

LoadSessionObject() public method

public LoadSessionObject ( IDataRecord record ) : void
record IDataRecord
return void
        public void LoadSessionObject(IDataRecord record)
        {
            Id = (Guid)record["ParameterUid"];
            Value = (Guid)record["Value"];
            SessionId = (Guid)record["SessionUid"];
            IsDelayed = (bool)record["IsDelayed"];
            ParameterType = (MapParameterType)record["ParameterType"];

            // As we are loading the object, we need to reset it so that it is aware when it becomes "dirty" or is actually a "new" object.
            IsNew = false;
            IsDirty = false;
            IsDbInstance = true;
        }
    }

Usage Example

示例#1
0
        public void LoadParameters()
        {
            SqlParameter sqlSessionParameter = new SqlParameter("@SessionId", MapObjects.Session.Id);

            SqlCommand selectParametersFromId = new SqlCommand(SelectParametersFromSessionId, MapObjects.ParametersDbConnection.Connection);

            selectParametersFromId.Parameters.Add(sqlSessionParameter);

            MapObjects.ParametersDbConnection.Open();

            IDataReader parameters = selectParametersFromId.ExecuteReader();

            while (parameters.Read())
            {
                MapParameter parameter = new MapParameter();

                parameter.LoadSessionObject(parameters);

                AddParameter(parameter);
            }

            MapObjects.ParametersDbConnection.Close();
        }
All Usage Examples Of TransactionalNodeService.MapParameter::LoadSessionObject