public CallResult GetTestStringFromDatabase() { //Backend, but... :)
StopWatchTimer timer = new StopWatchTimer();
timer.Start("Test database");
///Create test values in database
timer.StartNewLap("Save to database");
///This is backend
//TODO: move this to backend?
TestData testDataValue = TestData.New();
const string TextToTestDatabaseIoWith = "Hello from database!;)";
testDataValue.TestText = TextToTestDatabaseIoWith;
testDataValue.Save();
timer.StartNewLap("Read data from database");
var entryRead = TestData.ReadFirst("ID = @ID", "@ID", testDataValue.ID);
///end of Backend code ???
timer.Stop();
var response = string.Format("</br>Text from database: \"{0}\", </br> timer log: </br> {1}", entryRead.TestText, timer.ToString().Replace("\n", "</br>"));
testDataValue.Delete();
return new CallResult(response);
}
}