コード例 #1
0
ファイル: LocatorTypeStateDto.cs プロジェクト: uwitec/wms-8
        public virtual ILocatorTypeState ToLocatorTypeState()
        {
            var state = new LocatorTypeState(true);

            state.LocatorTypeId = this.LocatorTypeId;
            state.Description   = this.Description;
            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;
            }

            return(state);
        }
コード例 #2
0
        public virtual void Initialize(ILocatorTypeStateCreated stateCreated)
        {
            var aggregateId = stateCreated.LocatorTypeEventId.LocatorTypeId;
            var state       = new LocatorTypeState();

            state.LocatorTypeId = aggregateId;
            var aggregate = (LocatorTypeAggregate)GetLocatorTypeAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
コード例 #3
0
 public static CreateLocatorType ToCreateLocatorType(this LocatorTypeState state)
 {
     return(state.ToCreateLocatorType <CreateLocatorType>());
 }
コード例 #4
0
 public static MergePatchLocatorType ToMergePatchLocatorType(this LocatorTypeState state)
 {
     return(state.ToMergePatchLocatorType <MergePatchLocatorType>());
 }
コード例 #5
0
 public static DeleteLocatorType ToDeleteLocatorType(this LocatorTypeState state)
 {
     return(state.ToDeleteLocatorType <DeleteLocatorType>());
 }
コード例 #6
0
 public static ILocatorTypeCommand ToCreateOrMergePatchLocatorType(this LocatorTypeState state)
 {
     return(state.ToCreateOrMergePatchLocatorType <CreateLocatorType, MergePatchLocatorType>());
 }