protected AttributeStateDeleted NewAttributeStateDeleted(long version, string commandId, string requesterId) { var stateEventId = new AttributeEventId(_state.AttributeId, version); var e = NewAttributeStateDeleted(stateEventId); e.CommandId = commandId; e.CreatedBy = (string)requesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
protected virtual IAttributeStateMergePatched Map(IMergePatchAttribute c) { var stateEventId = new AttributeEventId(c.AttributeId, c.Version); IAttributeStateMergePatched e = NewAttributeStateMergePatched(stateEventId); e.AttributeName = c.AttributeName; e.OrganizationId = c.OrganizationId; e.Description = c.Description; e.IsMandatory = c.IsMandatory; e.AttributeValueType = c.AttributeValueType; e.AttributeValueLength = c.AttributeValueLength; e.IsList = c.IsList; e.FieldName = c.FieldName; e.ReferenceId = c.ReferenceId; e.Active = c.Active; e.IsPropertyAttributeNameRemoved = c.IsPropertyAttributeNameRemoved; e.IsPropertyOrganizationIdRemoved = c.IsPropertyOrganizationIdRemoved; e.IsPropertyDescriptionRemoved = c.IsPropertyDescriptionRemoved; e.IsPropertyIsMandatoryRemoved = c.IsPropertyIsMandatoryRemoved; e.IsPropertyAttributeValueTypeRemoved = c.IsPropertyAttributeValueTypeRemoved; e.IsPropertyAttributeValueLengthRemoved = c.IsPropertyAttributeValueLengthRemoved; e.IsPropertyIsListRemoved = c.IsPropertyIsListRemoved; e.IsPropertyFieldNameRemoved = c.IsPropertyFieldNameRemoved; e.IsPropertyReferenceIdRemoved = c.IsPropertyReferenceIdRemoved; e.IsPropertyActiveRemoved = c.IsPropertyActiveRemoved; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var version = c.Version; foreach (IAttributeValueCommand innerCommand in c.AttributeValueCommands) { ThrowOnInconsistentCommands(c, innerCommand); IAttributeValueEvent innerEvent = Map(innerCommand, c, version, _state); e.AddAttributeValueEvent(innerEvent); } foreach (IAttributeAliasCommand innerCommand in c.AttributeAliasCommands) { ThrowOnInconsistentCommands(c, innerCommand); IAttributeAliasEvent innerEvent = Map(innerCommand, c, version, _state); e.AddAttributeAliasEvent(innerEvent); } return(e); }
protected virtual IAttributeStateDeleted Map(IDeleteAttribute c) { var stateEventId = new AttributeEventId(c.AttributeId, c.Version); IAttributeStateDeleted e = NewAttributeStateDeleted(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); } AttributeEventId other = obj as AttributeEventId; if (other == null) { return(false); } return(true && Object.Equals(this.AttributeId, other.AttributeId) && Object.Equals(this.Version, other.Version) ); }
protected AttributeEventBase(AttributeEventId stateEventId) { this.AttributeEventId = stateEventId; }
public AttributeStateDeleted(AttributeEventId stateEventId) : base(stateEventId) { }
public AttributeStateMergePatched(AttributeEventId stateEventId) : base(stateEventId) { }
public AttributeStateCreated(AttributeEventId stateEventId) : base(stateEventId) { }
protected AttributeStateEventBase(AttributeEventId stateEventId) : base(stateEventId) { }
private AttributeStateDeleted NewAttributeStateDeleted(AttributeEventId stateEventId) { return(new AttributeStateDeleted(stateEventId)); }
private AttributeStateMergePatched NewAttributeStateMergePatched(AttributeEventId stateEventId) { return(new AttributeStateMergePatched(stateEventId)); }