Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# Entity Framework Basics Extending Our Entity Data Model Overriding the Context's OnModelCreating Method

Decimal Precision Attribute Annotation?

Q1) Can i change the precision of a decimal with an annotation? Also, is there any particular reason why we're using the type decimal instead of float or double?

Q2) If i specify the Table name with an annotation without removing the pluralizing convention will EF still pluralize it?

TIA

  • great course btw.

1 Answer

Steven Parker
Steven Parker
231,275 Points

I'm not aware of an annotation for decimal precision. But decimals are more precise than other floating point types and are particularly suited for financial values.

I don't believe it makes a difference in regard to pluralizing if the name comes from an annotation or not, but it might be worth doing a little experiment to confirm.

i checked using the table annotation and EF didn't pluralize the table name.