I would like to suppress these warnings but I could not figure out how to do it.
If we don't want to fix the warning, then we can suppress it with the @SuppressWarnings annotation. This annotation allows us to say which kinds of warnings to ignore. While warning types can vary by compiler vendor, the two most common are deprecation and unchecked.
Choose Build, and go to the Errors and warnings subsection. In the Suppress warnings or Suppress specific warnings box, specify the error codes of the warnings that you want to suppress, separated by semicolons.
It states if a warning had been suppressed by the #Disable Warning pragma. The state of a warning is either active or suppressed if it's enclosed in a pragma.
You are correct that these are warnings, not errors. The easiest way to supress the validation warnings from the compiler is to disable the Validate on Build property of the EF model. To do so, open your .edmx and select the background. Open the Properties window of Visual Studio and set Validate on Build to false. When you want to validate the model, just open the model again. There is also a right click context menu option on the model to Validate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With