예제 #1
0
 public void Activate()
 {
     if (State != RelationshipState.Active)
     {
         State = RelationshipState.Active;
     }
 }
예제 #2
0
 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;
 }
예제 #3
0
        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));
        }