Пример #1
0
 protected AttributeSetInstanceEventBase(AttributeSetInstanceState state)
 {
     if (state == null)
     {
         throw new ArgumentNullException();
     }
     this._state = state;
 }
Пример #2
0
        public virtual void Initialize(IAttributeSetInstanceStateCreated stateCreated)
        {
            var aggregateId = stateCreated.AttributeSetInstanceEventId.AttributeSetInstanceId;
            var state       = new AttributeSetInstanceState();

            state.AttributeSetInstanceId = aggregateId;
            var aggregate = (AttributeSetInstanceAggregate)GetAttributeSetInstanceAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
Пример #3
0
 public AttributeSetInstanceStateCreated(AttributeSetInstanceState state) : base(state)
 {
 }
Пример #4
0
 protected AttributeSetInstanceStateEventBase(AttributeSetInstanceState state) : base(state)
 {
 }
Пример #5
0
        public virtual IAttributeSetInstanceState ToAttributeSetInstanceState()
        {
            var state = new AttributeSetInstanceState(true);

            state.AttributeSetInstanceId = this.AttributeSetInstanceId;
            state.AttributeSetId         = this.AttributeSetId;
            state.OrganizationId         = this.OrganizationId;
            state.ReferenceId            = this.ReferenceId;
            state.SerialNumber           = this.SerialNumber;
            state.LotId           = this.LotId;
            state.ImageUrl        = this.ImageUrl;
            state.Description     = this.Description;
            state.Hash            = this.Hash;
            state.WidthInch       = this.WidthInch;
            state.DiameterInch    = this.DiameterInch;
            state.WeightLbs       = this.WeightLbs;
            state.WeightKg        = this.WeightKg;
            state.AirDryWeightLbs = this.AirDryWeightLbs;
            state.AirDryWeightKg  = this.AirDryWeightKg;
            state.AirDryMetricTon = this.AirDryMetricTon;
            state.RollCnt         = this.RollCnt;
            state.AirDryPct       = this.AirDryPct;
            state._F_B_0_         = this._F_B_0_;
            state._F_I_0_         = this._F_I_0_;
            state._F_L_0_         = this._F_L_0_;
            state._F_DT_0_        = this._F_DT_0_;
            state._F_N_0_         = this._F_N_0_;
            state._F_C5_0_        = this._F_C5_0_;
            state._F_C10_0_       = this._F_C10_0_;
            state._F_C20_0_       = this._F_C20_0_;
            state._F_C50_0_       = this._F_C50_0_;
            state._F_C100_0_      = this._F_C100_0_;
            state._F_C200_0_      = this._F_C200_0_;
            state._F_C500_0_      = this._F_C500_0_;
            state._F_C1000_0_     = this._F_C1000_0_;
            state._F_B_1_         = this._F_B_1_;
            state._F_I_1_         = this._F_I_1_;
            state._F_L_1_         = this._F_L_1_;
            state._F_DT_1_        = this._F_DT_1_;
            state._F_N_1_         = this._F_N_1_;
            state._F_C5_1_        = this._F_C5_1_;
            state._F_C10_1_       = this._F_C10_1_;
            state._F_C20_1_       = this._F_C20_1_;
            state._F_C50_1_       = this._F_C50_1_;
            state._F_C100_1_      = this._F_C100_1_;
            state._F_C200_1_      = this._F_C200_1_;
            state._F_B_2_         = this._F_B_2_;
            state._F_I_2_         = this._F_I_2_;
            state._F_L_2_         = this._F_L_2_;
            state._F_DT_2_        = this._F_DT_2_;
            state._F_N_2_         = this._F_N_2_;
            state._F_C5_2_        = this._F_C5_2_;
            state._F_C10_2_       = this._F_C10_2_;
            state._F_C20_2_       = this._F_C20_2_;
            state._F_C50_2_       = this._F_C50_2_;
            state._F_B_3_         = this._F_B_3_;
            state._F_I_3_         = this._F_I_3_;
            state._F_L_3_         = this._F_L_3_;
            state._F_DT_3_        = this._F_DT_3_;
            state._F_N_3_         = this._F_N_3_;
            state._F_C5_3_        = this._F_C5_3_;
            state._F_C10_3_       = this._F_C10_3_;
            state._F_C20_3_       = this._F_C20_3_;
            state._F_C50_3_       = this._F_C50_3_;
            state._F_B_4_         = this._F_B_4_;
            state._F_I_4_         = this._F_I_4_;
            state._F_L_4_         = this._F_L_4_;
            state._F_DT_4_        = this._F_DT_4_;
            state._F_N_4_         = this._F_N_4_;
            state._F_C5_4_        = this._F_C5_4_;
            state._F_C10_4_       = this._F_C10_4_;
            state._F_C20_4_       = this._F_C20_4_;
            state._F_C50_4_       = this._F_C50_4_;
            if (this.Active != null && this.Active.HasValue)
            {
                state.Active = this.Active.Value;
            }
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            state.CreatedBy = this.CreatedBy;
            if (this.CreatedAt != null && this.CreatedAt.HasValue)
            {
                state.CreatedAt = this.CreatedAt.Value;
            }
            state.UpdatedBy = this.UpdatedBy;
            if (this.UpdatedAt != null && this.UpdatedAt.HasValue)
            {
                state.UpdatedAt = this.UpdatedAt.Value;
            }
            if (this.StatusIds != null)
            {
                state.StatusIds = new HashSet <string>(this.StatusIds);
            }

            return(state);
        }