Ignore Data Annotation
See original GitHub issueIs your feature request related to a problem? Please describe.
The following situation:
What if you don’t want to save things in the DB, but still want to map them?
This does not work with the solution to use [NotMapped]
as Ignore attribute.
Describe the solution you’d like
Use a custom attribute such as [Ignore]
.
Describe alternatives you’ve considered
Removed [NotMapped]
attribute and implemented the NotMapped feature in EF Core via Fluent API.
Example:
modelbuilder.Entity<...>().Ignore(e => e.[Property)
Issue Analytics
- State:
- Created 4 months ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Ignoring a class property in Entity Framework 4.1 Code First
You can use the NotMapped attribute data annotation to instruct Code-First to exclude a particular property public class Customer { public ...
Read more >The Fluent API Ignore Method
The Entity Framework Core Fluent API provides two Ignore methods. One belongs to the ModelBuilder class and is used to specify that the...
Read more >Entity Framework Core Ignore Method
The Ignore method of the EF Core Fluent API is used to Ignore a Property or Entity ... Ignore Property; Ignore Entity; Data...
Read more >DataAnnotations - NotMapped Attribute in EF 6 & EF Core
The NotMapped attribute can be applied to properties of an entity class for which we do not want to create corresponding columns in...
Read more >Entity Framework 6.4.4 ignores data annotation attributes ...
When I then have Entity Framework create the database, all data annotations are being ignored: For example, there is no NOT NULL column...
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
done in 7.1.5
Thank you. Now it allows us to disable EF core mapping but not Dto to entity mapping