Improve of Fluent API
See original GitHub issueI can’t configure may serializer in this way:
return new ConfigurationContainer();
.EnableDeferredReferences();
.Type<IElement>().EnableReferences(p => p.Id);
.Type<Section>().EnableReferences(p => p.Id);
...
.Type<Building>().EnableReferences(p => p.Id)
.Create();
I have to do like below. Without use Fluent API.
var config = new ConfigurationContainer();
config.EnableDeferredReferences();
config.Type<IElement>().EnableReferences(p => p.Id);
config.Type<Section>().EnableReferences(p => p.Id);
...
config.Type<Building>().EnableReferences(p => p.Id);
return config.Create();
Issue Analytics
- State:
- Created 6 years ago
- Comments:41 (41 by maintainers)
Top Results From Across the Web
Best Practices for Designing a Fluent API
The first step in designing a fluent API is to decide which of those activities may be performed together and, as a result,...
Read more >Creating More Intuitive Code With a Fluent API
The benefits of a Fluent API are twofold. First, it improves the readability of your code by eliminating unnecessary syntax noise and making ......
Read more >Fluent-API: Creating Easier, More Intuitive Code with a ...
This concept, created in 2005 by Eric Evans and Martin Fowler, aims to increase code readability by creating a domain-specific language (DSL).
Read more >Is it better to use Fluent API or classic data anotations?
An important best-practice when using Fluent API is that you should not place all configurations in OnModelCreating as that will quickly turn ...
Read more >Fluent API: Practice and Theory
Besides, of course, proper documentation, the usability of an API is greatly influenced by its design. In this post we discuss fluent APIs, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve pushed first version of improvement of API. I would like to improve it but currently it works 😄 You can look. I’m open to comments and suggestions.
There is documentation for FluentAPI: https://github.com/wojtpl2/ExtendedXmlSerializer/tree/FluentAPI#fluent-api
There is a real example: https://github.com/wojtpl2/ExtendedXmlSerializer/blob/FluentAPI/samples/ExtendedXmlSerializer.Samples/FluentApi/FluentApiSamples.cs#L22-L32
Ok great. The fluent API is all yours now. 😃