Exemplo n.º 1
0
 public void Activate()
 {
     if (State != RelationshipState.Active)
     {
         State = RelationshipState.Active;
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 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));
        }