Exemple #1
0
 public static Strategy AsStrategy(this StrategyToken token)
 {
     return(new Strategy
     {
         id = token.id,
         name = token.name,
         owner = token.owner,
         last_modified = token.last_modified.GetValueOrDefault(DateTime.UtcNow),
         questions = token.questions == null ? new string[0] : token.questions,
         research = token.research == null ? new Research[0] : token.research.Select(r => r.AsResearch())
     });
 }
 public StrategyToken Create(StrategyToken token)
 {
     return _strategyRepository.Save(token.AsStrategy()).AsToken();
 }