public void Activate() { if (State != RelationshipState.Active) { State = RelationshipState.Active; } }
private Relationship(int id, MarketParticipantMrid marketParticipantMrid, RelationshipType type, RelationshipState state, Instant effectuationDate) { Id = id; MarketParticipantMrid = marketParticipantMrid ?? throw new ArgumentNullException(nameof(marketParticipantMrid)); Type = type ?? throw new ArgumentNullException(nameof(type)); EffectuationDate = effectuationDate; State = state; }
public static Relationship CreateFrom(RelationshipSnapshot snapshot) { if (snapshot is null) { throw new ArgumentNullException(nameof(snapshot)); } return(new Relationship( snapshot.Id, new MarketParticipantMrid(snapshot.MarketParticipantMrid), RelationshipType.FromValue <RelationshipType>(snapshot.Type), RelationshipState.FromValue <RelationshipState>(snapshot.State), snapshot.EffectuationDate)); }