The 'EmpGipNumber' property on 'Employee' could not be set to a 'System.String' value. You must set this property to a non-null value of type 'System.Int32'.
I'm getting this error, and my Employee Model's EmpGipNumber property is declared like this:
public virtual int? EmpGipNumber {get;set;}
why is it complaining, its a nullable int already. Ever since I enabled migrations I've been running into a large amount of problems.
The initial migration is empty because I enabled migrations on an existing database. The second migration is this:
public override void Up()
{
AlterColumn("dbo.Employee", "EmpGipNumber", c => c.Int());
}
it was working fine yesterday. Me going to sleep must've angered it
Without seeing more code, I'm wondering if it's a data issue. In my experience, it will convert any strings that tha can be parsed into ints... have you verified that the data you're converting can be parsed into an int?