Fluent API configuration
See original GitHub issueYour new fluent API isn’t really fluent api. Eg:
new ConfigurationContainer()
.ConfigureType<TestClassWithEncryptedData>()
.Member(p => p.Salary).Encrypt()
.Owner.Configuration
.ConfigureType<TestClassPrimitiveTypesNullable>()
.Member(p=>p.PropChar).Encrypt()
.Owner.Configuration
.UseEncryptionAlgorithm()
.Create();
In my last API it was easier to do this:
new ConfigurationContainer()
.ConfigureType<TestClassWithEncryptedData>()
.Member(p => p.Salary).Encrypt()
.ConfigureType<TestClassPrimitiveTypesNullable>()
.Member(p=>p.PropChar).Encrypt()
.UseEncryptionAlgorithm()
.Create();
In your solution all functions are public eg:
configuration.Find<EncryptionExtension>();
or
configuration.Add<Object>()
<-- you are really able to call this
In my only functions to configuration were public. All functions to internal use were internal. In your solution all function are public.
You can get my last API and you can check:
git checkout bca8b59a8f04e181a72b636d26597e1fc942738f
For me if you type .
in fluent api you should be able to call all functions from your level and all higher level.
What do you think? I wanted to do this but it is very difficult to change in your solution.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Fluent API Configuration
The Fluent API provides a larger range of configuration options than Data Annotation attributes. Fluent API configuration also facilitates cleaner code, ...
Read more >Creating and Configuring a Model - EF Core
Fluent API configuration has the highest precedence and will override conventions and data annotations. The configuration is applied in the ...
Read more >Fluent API in Entity Framework Core
Configurations Fluent API Methods Usage
Model Configurations HasDefaultSchema() Specifies the database schema.
Entity Configuration HasIndex() Configures an index of the specified properties.
Read more >Fluent API - Configuring and Mapping Properties and Types
There are two main ways you can configure EF to use something other than conventions, namely annotations or EFs fluent API.
Read more >Fluent API Configurations in EF 6
Configurations Fluent API Methods Usage
Model‑wide Configurations HasDefaultSchema() Specifies the default database schema.
Model‑wide Configurations ComplexType() Configures the class as complex type.
Entity Configurations HasIndex() Configures...
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 look over new API. It looks good. I need to more time to read it and understand all.
I’ve pushed one commit with updating documentation.
OK… I’ve committed in the new ConfigurationAPI, and have gotten rid of a lot of the extension methods. It’s not perfect, but it is more straight-forward and allows you to do the above. Or at least should. All tests are passing. So please take a look at this and if it looks OK to you, go ahead and release alpha 7.
If there are any significant changes that are needed, I would recommend moving them out to 2.1. I am not sure how much I will be able to do in this regard, however. It might take another pass or two to get this as desired, but I think it should do for now and v2. 😃