Skip to content

Add support for fetching an individual lazy property with Criteria #2097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 20, 2020

Conversation

bahusoid
Copy link
Member

@bahusoid bahusoid commented Apr 1, 2019

Follow up to #1922
To avoid accidental misuse with SelectMode.FetchLazyProperties new enum is called SelectMode.FetchLazyPropertyGroup (and not SelectMode.FetchLazyProperty)

Example of usage:

var entity = session.QueryOver<Entity>()
	.Fetch(
		SelectMode.FetchLazyPropertyGroup,
		 ec => ec.LazyProp1, ec => ec.LazyProp2, ec => ec.OtherEntity.LazyProp3)
	.Where(ec => ec.Id == id)
	.SingleOrDefault();

Fixes #1861

@hazzik
Copy link
Member

hazzik commented Jun 17, 2019

To avoid accidental misuse with SelectMode.FetchLazyProperties new enum is called SelectMode.FetchProperty (and not SelectMode.FetchLazyProperty)

What about changing name of the new value to FetchLazyPropertyGroup and old one to FetchAllLazyProperties (added "all")?

@hazzik
Copy link
Member

hazzik commented Jun 17, 2019

The commit with proposed changes is here: 6f38e03.

@bahusoid
Copy link
Member Author

FetchLazyPropertyGroup looks good and it makes it visually distinguishable with FetchLazyProperties. Renaming seems unnecessary to me. But no objections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lazy loading and Eager initialization for Component
3 participants