locked
.NET Core Data model validation question RRS feed

  • Question

  • User853731431 posted

    Have an application on a server and its working fine.  Not getting an error yet, but if someone adds a few columns to a table that each allow null, will this lead to model validation errors when my app runs an EF query or update?  Its one thing to add a new table that is NOT included in the EF data model, but adding columns to a table that is part of the EF data model seems like it could cause issues.  Will it?  I'm going to test this scenario since it seems to come up from time to time.

    Monday, December 16, 2019 2:09 PM

Answers

  • User-821857111 posted

    No it shouldn't cause problems. EF doesn't care about nullable columns that don't map to properties on entity classes. Unless they are mapped (either by adjusting the entity classes or by performing a migration), as far as EF Core is concerned, the columns won't exist at all.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 16, 2019 2:22 PM