Cześć,
Zamierzam powiązać dwie klasy w relacji wiele do wielu
public class Book
{
public int Id { get; set; }
public string Title { get; set; }
public ICollection<Author> Authors { get; set; }
public string PublishingHouse { get; set; }
public int NumberOfPages { get; set; }
public int ISBN { get; set; }
}
public class Author
{
public int Id { get; set; }
public string FirstName { get; set; }
public string SecondName { get; set; }
public string Nationality { get; set; }
public ICollection<Book> Books {get;set;}
}
Niestety automatyczna migracja nie przechodzi i wywala komunikat o tym, że powinienem wykonać tą operację manualnie. Macie jakieś pomysły dlaczego tak się dzieje? Nie wiem czy problem leży w konfiguracji moich klas, czy faktycznie powinienem zrobić to manualnie.
Unable to determine the relationship represented by navigation property 'Author.Books' of type 'ICollection<Book>'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.