I am using Entity Framework 5 - Code first.
I have a database that I am connecting to that already exists for some time now (I did not create it). There is a table
Another option to work out what the code first should be is to the MS EF Powertools http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d
You can add an empty project, right click, EF Reverse engineer code first from DB.
You often (not always) get a good start to the solution. Did you try using decimal?
public class Customer : IEntity
{
public decimal Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
if you are concerned precision, you should add validation to the POCO.
There are also some interesting Anotation hacks you may like. http://geekswithblogs.net/danemorgridge/archive/2010/12/20/ef4-code-first-control-unicode-and-decimal-precision-scale-with.aspx good luck