I keep getting the following error when trying to initialize my SQLite-NET database:
Cannot create a table without columns (does 'PersonModel' have public properties?)
I have a class PersonModel
that I want to be immutable, however SQLite is telling me that PersonModel
must be mutable, e.g. each property must use public set;
.
How can I continue using SQLite-NET with immutable properties?
class Person
{
public Person(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}
public string FirstName { get; } //Read-only Property, cannot be changed after initialization
public string LastName { get; } //Read-only Property, cannot be changed after initialization
}