Skip navigation links

MySQL Forums :: Connector/NET and C#, Mono, .Net :: Trouble with decimal precision and scale using Code First


Advanced Search

Trouble with decimal precision and scale using Code First
Posted by: Jared Jensen ()
Date: March 19, 2012 12:16PM

I'm trying to use Connector/Net 6.4.4 with EF 4.1 to generate a MySQL 5.5 decimal(19,4) column using the following code:

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Payment>().Property(x => x.Amount).IsRequired().HasColumnType("decimal").HasPrecision(19, 4);
}

But a decimal(10,0) column is generated instead. Am I missing something, or is this not supported by Connector/Net?

Options: ReplyQuote


Subject Written By Posted
Trouble with decimal precision and scale using Code First Jared Jensen 03/19/2012 12:16PM
Re: Trouble with decimal precision and scale using Code First Fernando Gonzalez 04/16/2012 04:48PM
Re: Trouble with decimal precision and scale using Code First Jared Jensen 04/17/2012 08:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.