Because I am a savvy developer (and slightly obsessive-compulsive), I don't want to see any compiler warnings after a build. Because I know these are non-issue warnings, I can safely disable them. Here's how to disable EF warnings in your projects:
First, the following are examples of these warnings (formatted to fit nicely on this page). These noremally appear in Visual Studio's Error List window:
Warning 26 Error 11007: Entity type 'LookupCode' is not mapped. 164 9 C:\development\MyProject\Main\Source\MyProject.Model\EntityModel.edmx MyProject.Model Warning 37 Error 11008: Association 'LookupCodeCustomer_MaritalStatus' is not mapped. 345 9 C:\development\MyProject\Main\Source\MyProject.Model\EntityModel.edmx MyProject.Model
These warnings are easily suppressed, by following these steps:
- Double-click the entity model in Visual Studio's Solution Explorer window, to open the model in the model designer
- If the Properties window is not already visible, press the F4 key
- Change the "Validate On Build" property to FALSE
- Save changes to the model
You're all set to go, warning free. Happy coding!
thanks a lot :) i need this post :)
ReplyDeletethanks a lot, too.
ReplyDeletegood code
ReplyDelete