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.

Ignore Data Annotation

See original GitHub issue

Is 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.


modelbuilder.Entity<...>().Ignore(e => e.[Property)

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

leonardoporrocommented, Jul 28, 2023

done in 7.1.5

Letsioncommented, Jul 31, 2023

Thank you. Now it allows us to disable EF core mapping but not Dto to entity mapping

Read more comments on GitHub >

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

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 Post

No results found

github_iconTop Related Hashnode Post

No results found