private ScoreEntity ScoreForCycleFromStorage(CycleIdentifier cycle) { var scoreEntity = new ScoreEntity(cycle); var retrieveOperation = TableOperation.Retrieve <ScoreEntity>(ScoreEntity.CincinnatiArea, scoreEntity.RowKey); var retrievedResult = _cloudTable.Execute(retrieveOperation); if (retrievedResult.Result == null) { // Execute the insert operation. //don't insert yet //_cloudTable.Execute(TableOperation.Insert(scoreEntity)); return(scoreEntity); } scoreEntity = (ScoreEntity)retrievedResult.Result; return(scoreEntity); }
private ScoreEntity ScoreForCycleFromStorage(CycleIdentifier cycle) { var scoreEntity = new ScoreEntity(cycle); var retrieveOperation = TableOperation.Retrieve<ScoreEntity>(ScoreEntity.CincinnatiArea, scoreEntity.RowKey); var retrievedResult = _cloudTable.Execute(retrieveOperation); if (retrievedResult.Result == null) { // Execute the insert operation. //don't insert yet //_cloudTable.Execute(TableOperation.Insert(scoreEntity)); return scoreEntity; } scoreEntity = (ScoreEntity) retrievedResult.Result; return scoreEntity; }