コード例 #1
0
 public JsonResult<ResponseViewModel<bool>> PostGameFeatures(GameFeatureViewModel[] gameFeatures)
 {
     var response =
         ServiceExecutor.Execute(() => _gameFeatureManagementService.PutGameFeatures(gameFeatures));
     return Json(response);
 }
コード例 #2
0
 public bool PutGameFeatures(GameFeatureViewModel[] gameFeatures)
 {
     gameFeatures.ToList().ForEach(InsertGameFeature);
     RepositoryFactory.Context.SaveChanges();
     return true;
 }
コード例 #3
0
 private void InsertGameFeature(GameFeatureViewModel gameFeature)
 {
     var entity =
         RepositoryFactory.Context.GameFeatureLanguages.FirstOrDefault(
             x => x.GameFeature.Id == gameFeature.Id && x.Language.Id == gameFeature.LanguageId);
     if (entity == null)
         throw new Exception(ThrowMessage.GameFeatureNotExists.ToString());
     entity.GameFeatureName = gameFeature.GameFeatureName;
 }
コード例 #4
0
 public bool PutGameFeature(GameFeatureViewModel gameFeature)
 {
     InsertGameFeature(gameFeature);
     RepositoryFactory.Context.SaveChanges();
     return true;
 }