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.

Select property by name & set a converter using Fluent Mapping

See original GitHub issue

How can I use FluentMappingBuilder or EntityMappingBuilder to select a property by name (and optionally by type) and set a converter to like Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder does.

builder.Property("propertyName").HasConversion(personalDataConverter);
builder.Property(typeof(string), "propertyName").HasConversion(personalDataConverter);
builder.Property<string>("propertyName").HasConversion(personalDataConverter);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
MaceWinducommented, Jun 16, 2020

per-column converters for both attribute-based and fluent mappings will be available in next release https://github.com/linq2db/linq2db/wiki/Release-Notes-3.0.0#value-converters-2273

I think it covers remaining items from this issue

1reaction
sdanylivcommented, Aug 1, 2019

Oops my fault

builder.Property(e => Sql.Property<string>(e, "propertyName"))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Property Mappings using Fluent API in EF Code- ...
The Fluent API can be used to configure properties of an entity to map it with a db column. Using Fluent API, you...
Read more >
Fluent API - Configuring and Mapping Properties and Types
This article is designed to demonstrate how to use the fluent API to configure properties. The code first fluent API is most commonly ......
Read more >
Value Conversions - EF Core
Configuring value converters in an Entity Framework Core model. ... Value converters allow property values to be converted when reading from ...
Read more >
entity framework - C# EF6 conditional property selection?
I used System.Linq.Dynamic for this very successfully. You can pass a string as the select statement in the following format: .
Read more >
Bindings (JavaFX 8)
Generates a bidirectional binding (or "bind with inverse") between a String - Property and another Property using the specified StringConverter for conversion.
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