23 lines
520 B
C#
23 lines
520 B
C#
using SQLite;
|
|
using System.IO;
|
|
|
|
namespace MauiAppStock.Data
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
} |