Skip to content

Removed string based API from the mapping API#152

Merged
pawelpabich merged 4 commits into
sl/primarykeyhandlersfrom
pp/typedids
Jun 22, 2021
Merged

Removed string based API from the mapping API#152
pawelpabich merged 4 commits into
sl/primarykeyhandlersfrom
pp/typedids

Conversation

@pawelpabich
Copy link
Copy Markdown
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

@pawelpabich pawelpabich requested a review from slewis74 June 21, 2021 22:56
Copy link
Copy Markdown
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.

public abstract class PrimaryKeyHandler<T> : IPrimaryKeyHandler
{
public Type Type => typeof(T);
public virtual Type Type => typeof(T);
Copy link
Copy Markdown
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.

2 participants