[ManyToMany]
Used to specify a Many to Many relationship. Because EF core does not support automatic intermediate mapping tables, this field is used to allow for direct reference of the many-to-many collections from the ViewModel.
The named specified in the attribute will be used as the name of a collection of the objects on the other side of the relationship in the generated TypeScript ViewModels.
Example Usage
public class Person
{
public int PersonId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
[ManyToMany("Appointments")]
public ICollection<PersonAppointment> PersonAppointments { get; set; }
}
Properties
// ONLY settable via constructor parameter #1
public string CollectionName { get; }
// ONLY settable via constructor parameter #1
public string CollectionName { get; }
The name of the collection that will contain the set of objects on the other side of the many-to-many relationship.
public string FarNavigationProperty { get; set; }
public string FarNavigationProperty { get; set; }
The name of the navigation property on the middle entity that points at the far side of the many-to-many relationship. Use this to resolve ambiguities when the middle table of the many-to-many relationship has more than two reference navigation properties on it.