Suppressing LINQ to SQL DBML warnings

I created LINQ to SQL classes from a database that is not under my control, which has many Decimal(38, 5) fields Decimal(38, 5) . The .NET Decimal type range seems to be less than this, so the LINQ to SQL code generator generates a lot of warnings:

DBML1008: matching between DbType "Decimal (38,5)" and "System.Decimal" in the "StructGable24InchOCStuds" column of the "AddersAndMultiplier" type may result in data loss when loading from the database

It is extremely unlikely that any of these fields will ever have a value sufficient for data loss in practice, so I would like to suppress these warnings. However, apparently setting a warning in the VS dialog does not work with LINQ to SQL code generator warnings - is there another method?

+6
visual-studio-2010 linq-to-sql suppress-warnings
source share
1 answer

I'm not sure how to suppress the warning, but since I have control over the stored procedure that was causing the problem on my system, I returned the return value to the smaller decimal place that removed the warning.

 SELECT CAST(SUM(AdFee) AS DECIMAL(19, 3)) 
+3
source share

All Articles