Skip to content

Instantly share code, notes, and snippets.

@dsibinski

dsibinski/Person_Event.cs

Last active May 18, 2017
Embed
What would you like to do?
// 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
You can’t perform that action at this time.