Skip to content

Shut up and put your RelatedEnd in my Sidecar... #320

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

Closed
wants to merge 1 commit into from

Conversation

ajcvickers
Copy link
Contributor

Shut up and put your RelatedEnd in my Sidecar... (Initial support for navigation to FK fixup)

This is very early support for fixup of FKs following navigation property change. Only fixup of dependent to principal reference navigations is supported for now--no collection fixup or inverse property fixup. Specific changes:

  • Refactor Sidecar to allow it to be used with IPropertyBase and hence navigations as well as normal properties
  • Similar updates to StateEntry to allow navigation property values to be obtained in the same way as normal property values
  • Update FK snapshot to also snapshot navigations--will rename in a different checkin
  • Simple detection of reference changes using the snaphot or notifications triggering a call on the listener that then does simple fixup

… navigation to FK fixup)

This is very early support for fixup of FKs following navigation property change. Only fixup of dependent to principal reference navigations is supported for now--no collection fixup or inverse property fixup. Specific changes:
- Refactor Sidecar to allow it to be used with IPropertyBase and hence navigations as well as normal properties
- Similar updates to StateEntry to allow navigation property values to be obtained in the same way as normal property values
- Update FK snapshot to also snapshot navigations--will rename in a different checkin
- Simple detection of reference changes using the snaphot or notifications triggering a call on the listener that then does simple fixup
}
else
{
var navigation = propertyBase as INavigation;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can propertyBase be anything other than INavigation on this path? If not a cast may be preferable instead of "as".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that IPropertyBase is a public interface the actual type could be something that is not INavigation. That being said in normal usage it currently will always be an INavigation here. But the idea here is to do something specific to navigations if the property is a navigation, as opposed to do one thing or the other depending on the type, so all in all I feel that the as is more appropriate here.

@ghost
Copy link

ghost commented Jun 18, 2014

:shipit:

@ajcvickers
Copy link
Contributor Author

Merged.

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

Successfully merging this pull request may close these issues.

1 participant