Skip to content

Avoids unnecessary allocations#732

Open
canadacubachina wants to merge 1 commit into
OrchardCMS:mainfrom
canadacubachina:performance
Open

Avoids unnecessary allocations#732
canadacubachina wants to merge 1 commit into
OrchardCMS:mainfrom
canadacubachina:performance

Conversation

@canadacubachina
Copy link
Copy Markdown

Fix #731

Copy link
Copy Markdown
Contributor

@sarahelsaig sarahelsaig left a comment

Choose a reason for hiding this comment

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

In LoginInfoJsonConverter the instance is registered in code (see here).
The created Instance variables here are not actually used.

@infofromca
Copy link
Copy Markdown
Contributor

In LoginInfoJsonConverter the instance is registered in code (see here). The created Instance variables here are not actually used.

As a lib or nuget, we can create it for the extensible for other custom module to extend by registration and DI

@sarahelsaig
Copy link
Copy Markdown
Contributor

As a lib or nuget, we can create it for the extensible for other custom module to extend by registration and DI

That's not useful. You should never have to use these converters directly, because are tied to the converted class using an attribute: [JsonConverter(typeof(AmountConverter))].

If for some reason you still need an instance of the converter, you can create a static instance in your own code. Adding these static properties here would only be confusing for everyone else.

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.

Follow the way of LoginInfoJsonConverter (OCC-439)

3 participants