HegreHotel/SingletonConnection.cs

24 lines
540 B
C#

using SQLite;
using System.IO;
using Microsoft.Maui.Storage;
namespace HegreHotel
{
public class SingletonConnection : SQLiteAsyncConnection
{
private static SingletonConnection instance;
private SingletonConnection(string dbPath) : base(dbPath)
{
}
public static SingletonConnection GetInstance(string dbPath)
{
if (instance == null)
{
instance = new SingletonConnection(dbPath);
}
return instance;
}
}
}