Skip to content

Instantly share code, notes, and snippets.

@Sa1Gur
Created August 19, 2019 21:00
Show Gist options
  • Save Sa1Gur/25050fed01b7d32795254916152fee4e to your computer and use it in GitHub Desktop.
Save Sa1Gur/25050fed01b7d32795254916152fee4e to your computer and use it in GitHub Desktop.
TeamMatesViewModel.cs
public readonly SQLiteConnection conn;
...
public TeamMatesViewModel()
{
...
conn = new SQLiteConnection($@"{FileSystem.AppDataDirectory}/teammates.db3");
TeamMateSquad = new ObservableCollection<TeamMateItem>(conn.Table<TeamMateItem>().ToList());
}
TeamMateItem.cs
[Table("teammates")]
public class TeamMateItem : INotifyPropertyChanged
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
...
[MaxLength(250), Unique]
public string Name
...
[MaxLength(10)]
public uint Level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment