entity framework property can't be set to string, has to be nullable int

c# entity-framework entity-framework-6 sql

Question

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 receiving the following problem, and the EmpGipNumber attribute of my Employee Model is declared as follows:

public virtual int? EmpGipNumber {get;set;}

Why is it complaining when it is already a nullable int? I have had a lot of issues ever since I enabled migrations.

Because I enabled migrations on an existing database, the initial migration is empty. This is the second migration:

public override void Up()
        {
            AlterColumn("dbo.Employee", "EmpGipNumber", c => c.Int());
        }

It was operating smoothly yesterday. It must have been enraged by my going to sleep.

1
-1
1/30/2015 2:06:55 PM

Accepted Answer

ZZZ_tmp
1
1/30/2015 2:13:05 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow