TransactionalNodeService.Common.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

Ejemplo n.º 1
0
        public void LoadParameters()
        {
            SqlParameter sqlSessionParameter = new SqlParameter("@SessionId", GlymaSession.Session.Id);

            using (IDbConnectionAbstraction parametersDbConnection = GlymaSession.ConnectionFactory.CreateParametersDbConnection())
            {
                SqlCommand selectParametersFromId = new SqlCommand(SelectParametersFromSessionId, parametersDbConnection.Connection);
                selectParametersFromId.Parameters.Add(sqlSessionParameter);

                parametersDbConnection.Open();

                IDataReader parameters = selectParametersFromId.ExecuteReader();

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

                    parameter.LoadSessionObject(parameters);

                    AddParameter(parameter);
                }

                parametersDbConnection.Close();
            }
        }
All Usage Examples Of TransactionalNodeService.Common.MapParameter::LoadSessionObject