Created
June 28, 2014 18:41
-
-
Save benhysell/c408d3d106123cae5f05 to your computer and use it in GitHub Desktop.
Building Sql Object MvvmCross
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Creates the app. | |
/// </summary> | |
/// <returns>An instance of IMvxApplication.</returns> | |
protected override IMvxApplication CreateApp() | |
{ | |
var connectionParameters = new SQLiteConnectionString(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "database.db"), false); | |
var sqliteConnectionPool = new SQLiteConnectionPool(new SQLitePlatformAndroid()); | |
var connection = new SQLiteAsyncConnection(() => sqliteConnectionPool.GetConnection(connectionParameters)); | |
Mvx.RegisterSingleton<SQLiteAsyncConnection>(connection); | |
return new Core.App(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Creates the app. | |
/// </summary> | |
/// <returns>An instance of IMvxApplication</returns> | |
protected override IMvxApplication CreateApp() | |
{ | |
var connectionParameters = new SQLiteConnectionString(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "database.db"), false); | |
var sqliteConnectionPool = new SQLiteConnectionPool(new SQLitePlatformIOS()); | |
var connection = new SQLiteAsyncConnection(() => sqliteConnectionPool.GetConnection(connectionParameters)); | |
Mvx.RegisterSingleton<SQLiteAsyncConnection>(connection); | |
return new Core.App(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override IMvxApplication CreateApp() | |
{ | |
var connectionParameters = new SQLiteConnectionString(Path.Combine(ApplicationData.Current.LocalFolder.Path, "database.db"), false); | |
var sqliteConnectionPool = new SQLiteConnectionPool(new SQLitePlatformWP8()); | |
var connection = new SQLiteAsyncConnection(() => sqliteConnectionPool.GetConnection(connectionParameters)); | |
Mvx.RegisterSingleton<SQLiteAsyncConnection>(connection); | |
return new Core.App(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment