Question: I have Reporting\_officers Table.structure of table is below

```
R_id    User_id Manager_id  Managre2_id
1        4       3        3
2        3       2        2
3        5       3        2

```

now i want update user\_id 3 to 6 in this table, then it should reflect to manager\_id and manger2\_id which have 3 
like below

```
R_id    User_id   Manager_id  Managre2_id
 1          4         6           6
 2          6         2           2
 3          5         6           2

```

Answer: 
Please try 

```
AddColumn("dbo.Props", "Prop1", c => c.Double());   
AddColumn("dbo.Props", "Prop2", c => c.Int());
Sql("UPDATE dbo.Props SET Prop1 = 0, Prop2 = 0 WHERE Discriminator = 'MyProp'");

```

The idea is to update with not null value the old values from DB table with Discriminator "MyProp"
You added the two fields as nullable in the db (nullable: true) but your model (object) has these type declared as non nullable. So EF is trying to assign a null value to non nulalble properties. Make the object properties nulallbe like so:

```
public class MyProp: PropBase
{
   public double Prop10 { get; set; }
   public double? Prop1{ get; set; }    // new property
   public int? Prop2{ get; set; }       // new property
}

```

Or you must make the columns non nullalbe (nullable: false) in the database.

If you want it nullable but still need a default value of 0 then you can do something like this:

```
public class MyProp: PropBase
{
 private double? _prop1;
 private double? _prop2;

 public double Prop10 { get; set; }
 public double? Prop1
 {   
    get
    {
        if(!this._prop1.HasValue)
            this._prop1 = 0;

        return this._prop1;
    }
    set
    {
        this._prop1 = value;
    } 
 }
 public int? Prop2
 {   
    get
    {
        if(!this._prop2.HasValue)
            this._prop2 = 0;

        return this._prop2;
    }
    set
    {
        this._prop2 = value;
    } 
 }    
}

```