Skip to content

Instantly share code, notes, and snippets.

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 ssougnez/2f773190e28c2d961f54ead22368c85c to your computer and use it in GitHub Desktop.
Save ssougnez/2f773190e28c2d961f54ead22368c85c to your computer and use it in GitHub Desktop.
var sql = new Sql()
.Select("Movies.*, Directors.*")
.From<Movie>(dbContext.SqlSyntax)
.InnerJoin<Director>(dbContext.SqlSyntax)
.On<Movie, Director>(dbContext.SqlSyntax, m => m.DirectorId, d => d.Id);
var movies = dbContext.Database.Fetch<Movie, Director, Movie>((m, d) =>
{
m.Director = d;
return m;
}, sql);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment