I have two entities `Transaction` and `DiscountType`

**Transaction:**

```
public class Transaction
{
    [Key]
    public int TransactionID { get; set; }
    public virtual DiscountType DiscountType { get; set; }
}

```

**DiscountType:**

```
public class DiscountType
{
    [Key]
    public int DiscountTypeID { get; set; }
    public virtual ICollection<Transaction> Transactions { get; set; }
    public float DiscountValue { get; set; }
    public bool Enabled {get; set;}
}

```

**Relationship:**

```
 modelBuilder.Entity<DiscountType>().HasMany(d => d.Transactions);

```

**Aim:**

I am trying to remove the relationship between the Transaction and the DiscountType, without actually removing either entity.

**Problem:**

Now I'm having no problem assigning a Discount to a transaction, but when I do the following:

```
 var transaction = context.Transactions.Where(t => t.TransactionID == 1).First();
 transaction.DiscountType = context.DiscountTypes.Where(d => d.DiscountTypeID == 1).First();
 context.SaveChanges();

 var _transaction = context.Transactions.Where(t => t.TransactionID == 1).First();
 _transaction.DiscountType = null;
 context.SaveChanges();

```

It's quite a peculiar problem I'm having. When this code is ran it does not remove the relationship between the two.

**Actual Code:**

![As you can see, even after the <code>= null;</code> is executed, it still remains.](https://i.stack.imgur.com/FrLLu.png)

As you can see, even after the `= null;` is executed, it still remains.