示例#1
0
 public DisplayScoreResponse DisplayScore(DisplayScoreRequest request)
 {
     var player = _playerRepository.Get(request.PlayerId);
     return new DisplayScoreResponse
     {
         Score = player.CalculateScore()
     };
 }
示例#2
0
 public JsonResult DisplayScore(DisplayScoreRequest request)
 {
     try
     {
         var response = _colorService.DisplayScore(request);
         var model = _colorModelFactory.CreateDisplayScoreModel(response);
         return JsonResult.CreateSuccess(model);
     }
     catch (Exception ex)
     {
         return JsonResult.CreateFailure(ex.Message, ex);
     }
 }