I am building an app within Xamarin and running into Error CS0050 for the 'Database' method name. Here is my current code:
using System.IO;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Something
{
public partial class App : Application
{
private static Database database;
public static Database Database
{
get
{
if (database == null)
{
database = new Database(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "items.db3"));
}
return database;
}
}
//adding in the local database: https://www.youtube.com/watch?v=uxqQqyuZ3Qo
public App()
{
InitializeComponent();
MainPage = new MainPage();
}
}
...}
I have tried changing both the 'Database' method name and the variable 'database' above it into different combinations of private/public. Each time makes more problems. This method is referenced in other files so it must be public.
I used this tutorial as a reference when creating this and he never had this issue: https://www.youtube.com/watch?v=uxqQqyuZ3Qo
Thanks for the help in advance!
Complete text: error CS0053: Inconsistent accessibility: property type 'Database' is less accessible than property 'App.Database'