Friday, 15 May 2015

sql server - How can I drop second Primary Key in MVC model? -



sql server - How can I drop second Primary Key in MVC model? -

i have model has 2 primary key. wanna drop 1 of them got error.

my model;

public class equipment { [key] [column(order = 0)] public int equipmentid { get; set; } [key] [column(order = 1)] public string name { get; set; } }

and wanna drop name columns' key.

public class equipment { [key] public int equipmentid { get; set; } public string name { get; set; } }

when seek that, got error like;

'fk_dbo.employee_equipment_dbo.equipments_equipments_equipmentid_equipments_name' not constraint. not drop constraint. see previous errors.

use should remove db wrong data. info should delete repeat equipmentid row.

sql-server asp.net-mvc asp.net-mvc-4

No comments:

Post a Comment