Skip to content

Instantly share code, notes, and snippets.

@dsibinski
Last active May 18, 2017 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsibinski/1b0f1411d6478c7bebc55a451fbda068 to your computer and use it in GitHub Desktop.
Save dsibinski/1b0f1411d6478c7bebc55a451fbda068 to your computer and use it in GitHub Desktop.
// Person class modelling People table
[Table("People")]
public class Person
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
public string LastName { get; set; }
public string PhoneNumber { get; set; }
public string Email { get; set; }
[ManyToMany(typeof(PersonEvent))]
public List<Event> Events { get; set; }
}
// Event class modelling Events table
[Table("Events")]
public class Event
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
public DateTime Date { get; set; }
public string Place { get; set; }
[ManyToMany(typeof(PersonEvent))]
public List<Person> Participants { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment