Skip to content
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

[Search] Add missing property when cloning SearchOptions #27582

Merged
merged 4 commits into from
Apr 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify code by using PropertyInfo efficiently
  • Loading branch information
Mohit-Chakraborty committed Mar 16, 2022
commit 042ed1ce414ff05d34a0c5ff0917ddb9cb25cd7d
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,9 @@ private static void Copy(SearchOptions source, SearchOptions destination)
Debug.Assert(source != null);
Debug.Assert(destination != null);

foreach (System.Reflection.PropertyInfo sourcePropertyInfo in source.GetType().GetProperties())
foreach (System.Reflection.PropertyInfo propertyInfo in typeof(SearchOptions).GetProperties())
{
System.Reflection.PropertyInfo destinationPropertyInfo = destination.GetType().GetProperty(sourcePropertyInfo.Name);
destinationPropertyInfo.SetValue(destination, sourcePropertyInfo.GetValue(source));
propertyInfo.SetValue(destination, propertyInfo.GetValue(source));
}
}

Expand Down