protected virtual IAttributeSetStateCreated Map(ICreateAttributeSet c) { var stateEventId = new AttributeSetEventId(c.AttributeSetId, c.Version); IAttributeSetStateCreated e = NewAttributeSetStateCreated(stateEventId); e.AttributeSetName = c.AttributeSetName; e.OrganizationId = c.OrganizationId; e.Description = c.Description; e.ReferenceId = c.ReferenceId; e.IsInstanceAttributeSet = c.IsInstanceAttributeSet; e.IsMandatory = c.IsMandatory; e.Active = c.Active; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var version = c.Version; foreach (ICreateAttributeUse innerCommand in c.AttributeUses) { ThrowOnInconsistentCommands(c, innerCommand); IAttributeUseStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddAttributeUseEvent(innerEvent); } return(e); }
protected AttributeSetStateDeleted NewAttributeSetStateDeleted(long version, string commandId, string requesterId) { var stateEventId = new AttributeSetEventId(_state.AttributeSetId, version); var e = NewAttributeSetStateDeleted(stateEventId); e.CommandId = commandId; e.CreatedBy = (string)requesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
protected virtual IAttributeSetStateDeleted Map(IDeleteAttributeSet c) { var stateEventId = new AttributeSetEventId(c.AttributeSetId, c.Version); IAttributeSetStateDeleted e = NewAttributeSetStateDeleted(stateEventId); e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } AttributeSetEventId other = obj as AttributeSetEventId; if (other == null) { return(false); } return(true && Object.Equals(this.AttributeSetId, other.AttributeSetId) && Object.Equals(this.Version, other.Version) ); }
protected AttributeSetEventBase(AttributeSetEventId stateEventId) { this.AttributeSetEventId = stateEventId; }
public AttributeSetStateDeleted(AttributeSetEventId stateEventId) : base(stateEventId) { }
public AttributeSetStateMergePatched(AttributeSetEventId stateEventId) : base(stateEventId) { }
protected AttributeSetStateEventBase(AttributeSetEventId stateEventId) : base(stateEventId) { }
private AttributeSetStateDeleted NewAttributeSetStateDeleted(AttributeSetEventId stateEventId) { return(new AttributeSetStateDeleted(stateEventId)); }
private AttributeSetStateMergePatched NewAttributeSetStateMergePatched(AttributeSetEventId stateEventId) { return(new AttributeSetStateMergePatched(stateEventId)); }