question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve of Fluent API

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:41 (41 by maintainers)

github_iconTop GitHub Comments

2reactions
WojciechNagorskicommented, Oct 25, 2017

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

1reaction
Mike-E-angelocommented, Nov 7, 2017

Ok great. The fluent API is all yours now. 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found