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

Removed string based API from the mapping API #152

Merged
merged 4 commits into from
Jun 22, 2021

Conversation

pawelpabich
Copy link
Contributor

This PR builds on top of #149 and changes 2 things:

  1. It fixes a problem where a wrong KeyHandler was assigned for documents with custom prefix
  2. Now that Ids can be of a different type than string we should remove string based APIs like Format and Prefix and move where they belong, which is specific KeyHandlers

This is a breaking change. That being said Octofront doesn't use IdPrefix and most of the cases in the server can be simply removed as the duplicate what Nevermore already does internally.

image

Copy link
Contributor

@slewis74 slewis74 left a comment

Choose a reason for hiding this comment

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

Very nice, I was trying to stay too close to the original idea for IdPrefix etc, this is much tidier 👍

One question inline about a virtual on the Type property.

@@ -6,7 +6,7 @@ namespace Nevermore.Mapping
{
public abstract class PrimaryKeyHandler<T> : IPrimaryKeyHandler
{
public Type Type => typeof(T);
public virtual Type Type => typeof(T);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need to be virtual? It is only meant to represent the underlying type, so I'm not sure it'd be a good idea for an inheriting class to override it.

@pawelpabich pawelpabich merged this pull request into sl/primarykeyhandlers Jun 22, 2021
@pawelpabich pawelpabich deleted the pp/typedids branch June 22, 2021 02:21
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.

None yet

2 participants