0

I had an Include method like so

public static IQueryable<SlideSet> IncludeParameters(this IDbSet<SlideSet> storage) {
    return storage.Include(ss => ss.Params.Select(x => x.Parameter));
}

I am cleaning up my domain model and it no longer makes sense to have SlideSet.Params be public.

I know that there is a form of IDbSet<>.Include() that takes a string parameter. What is the syntax for using a string while descending into the child property like this?

btw, for those who are wondering, I'm pretty sure

return storage.Include(ss => ss.Params.Select(x => x.Parameter));

is identical to

return storage.Include(ss => ss.Params.Include(x => x.Parameter));

1 Answer 1

2

Just use .:

return storage.Include("Params.Parameter");
Sign up to request clarification or add additional context in comments.

2 Comments

Ok thanks, its kind of a big refactoring and I wanted to make sure it was possible before forging ahead.
For completeness sake, the docs for IQueryable.Inclue mention this, just not the docs for the more specific IDbset.Include where I was looking... Ugh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.