Exemple #1
0
 private Bet(BetState state)
 {
     _betId        = new BetId(state.BetId);
     _endDate      = new EndDate(state.EndDate);
     _coins        = state.Coins;
     _creator      = state.Creator;
     _description  = state.Description;
     _creationDate = state.CreationDate;
     _answers      = new Dictionary <Member, Answer>(
         state.Answers?.Select(x =>
                               new KeyValuePair <Member, Answer>(
                                   x.Member,
                                   new Answer(x.IsAccepted, x.DateAnswer)
                                   )
                               ));
     _isSuccess = state.IsSuccess;
     _closeDate = state.CloseDate;
     _status    = state.Status;
 }
Exemple #2
0
 public static Bet FromState(BetState state)
 {
     return(new Bet(state));
 }