Shibly  Sadik

Shibly Sadik

  • 1.5k
  • 167
  • 134.6k

Insert duplicate key in entity framework

Jul 2 2015 5:41 AM
I have a model class with primary key ID.

public class Order
{
public int ID { get;set }
public string Product_Name { get;set }
public string Product_Brand { get;set }
}

I want to add the product items in a database where one product can be added more than one time..

Now how can i insert same product ignoring "duplicate key insertion problem"?? Is there any way to do this??
Help please...

Answers (2)