Skip to content

Instantly share code, notes, and snippets.

@Delaire
Created December 31, 2019 13:18
Show Gist options
  • Save Delaire/9f21da5a156751552522f670feae6784 to your computer and use it in GitHub Desktop.
Save Delaire/9f21da5a156751552522f670feae6784 to your computer and use it in GitHub Desktop.
public class DatabaseService : IDatabaseService
{
public string GetDatabasePath()
{
string dbPath = "";
if (Device.RuntimePlatform == Device.Android)
{
dbPath= Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), AppConstants.DatabaseName);
}
else if (Device.RuntimePlatform == Device.iOS)
{
dbPath= Path.Combine(Environment.GetFolderPath(
Environment.SpecialFolder.MyDocuments),
"..",
"Library",
AppConstants.DatabaseName);
}
return $"Filename={dbPath}";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment