Example of how to implement local database in your Xamarin.Forms applications - http://julianocustodio.com/litedb
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
using DemoLiteDB.iOS; | |
using System; | |
using System.IO; | |
using Xamarin.Forms; | |
[assembly: Dependency(typeof(Helper))] | |
namespace DemoLiteDB.iOS | |
{ | |
public class Helper : IHelper | |
{ | |
public string GetFilePath(string file) | |
{ | |
string document = Environment.GetFolderPath(Environment.SpecialFolder.Personal); | |
string library = Path.Combine(document, "..", "Library", "Databases"); | |
if (!Directory.Exists(library)) | |
{ | |
Directory.CreateDirectory(library); | |
} | |
return Path.Combine(library, file); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment