protected virtual IAttributeStateCreated Map(ICreateAttribute c) { var stateEventId = new AttributeStateEventId(c.AttributeId, c.Version); IAttributeStateCreated e = NewAttributeStateCreated(stateEventId); e.Name = c.Name; e.OrganizationId = c.OrganizationId; e.Description = c.Description; e.IsMandatory = c.IsMandatory; e.IsInstanceAttribute = c.IsInstanceAttribute; e.AttributeValueType = c.AttributeValueType; e.AttributeValueLength = c.AttributeValueLength; e.IsList = c.IsList; e.FieldName = c.FieldName; e.ReferenceId = c.ReferenceId; e.Active = c.Active; ReflectUtils.CopyPropertyValue("CommandId", c, e); e.CreatedBy = (string)c.RequesterId; e.CreatedAt = DateTime.Now; var version = c.Version; foreach (ICreateAttributeValue innerCommand in c.AttributeValues) { ThrowOnInconsistentCommands(c, innerCommand); IAttributeValueStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddAttributeValueEvent(innerEvent); } return(e); }
protected AttributeStateDeleted NewAttributeStateDeleted(string commandId, string requesterId) { var stateEventId = new AttributeStateEventId(_state.AttributeId, ((IAttributeStateProperties)_state).Version); var e = NewAttributeStateDeleted(stateEventId); e.CommandId = commandId; e.CreatedBy = (string)requesterId; e.CreatedAt = DateTime.Now; return(e); }
protected virtual IAttributeStateDeleted Map(IDeleteAttribute c) { var stateEventId = new AttributeStateEventId(c.AttributeId, c.Version); IAttributeStateDeleted e = NewAttributeStateDeleted(stateEventId); ReflectUtils.CopyPropertyValue("CommandId", c, e); e.CreatedBy = (string)c.RequesterId; e.CreatedAt = DateTime.Now; return(e); }
public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } AttributeStateEventId other = obj as AttributeStateEventId; if (other == null) { return(false); } return(true && Object.Equals(this.AttributeId, other.AttributeId) && Object.Equals(this.Version, other.Version) ); }
public AttributeStateDeleted(AttributeStateEventId stateEventId) : base(stateEventId) { }
public AttributeStateMergePatched(AttributeStateEventId stateEventId) : base(stateEventId) { }
public AttributeStateCreated(AttributeStateEventId stateEventId) : base(stateEventId) { }
protected AttributeStateEventBase(AttributeStateEventId stateEventId) { this.StateEventId = stateEventId; }
public AttributeStateEventIdFlattenedDto(AttributeStateEventId val) { this._value = val; }
private AttributeStateDeleted NewAttributeStateDeleted(AttributeStateEventId stateEventId) { return(new AttributeStateDeleted(stateEventId)); }
private AttributeStateMergePatched NewAttributeStateMergePatched(AttributeStateEventId stateEventId) { return(new AttributeStateMergePatched(stateEventId)); }