Entity Framework double join
public class SomeContext: DbContext
{
public SometContext(DbContextOptions<SomeContext> options) : base(options) { }
public DbSet<SomeJoinTable> Relationships { get; set; }
public DbSet<Author> Authors { get; set; }
public DbSet<Books> Books { get; set; }
public string GetTemplateMethods(string models)
{
var result = (from _relationships in Relationships
join _books in Books on <left-hand comparator> equals <right-hand comparator>
join _authors in Authors on _relationships.AuthorId equals _books.AuthorId
select new
{
AuthorName = _authors.MethodName,
AuthorId = _authors.AuthorId,
BookId = _books.BookId
}).ToList();
return JsonConvert.SerializeObject(result);
}
}