I have a table whose structure is composed of two PK, I want to include it in my model to insert records to it, but I have problems doing this
my question is how do I declare in my model that I have those two fields as pk, I tried that way but it throws error
namespace MvcApp.Models
{
public class credito_por_factura
{
[Key]
public decimal id_factura { get; set; }
[Key]
public decimal id_credito { get; set; }
}
}
ERROR: The composite primary key order can not be determined for the type 'MvcApp.Models.credito_per_factura'. Use the HasKey or ColumnAttribute method to specify the order of the composite primary keys.
NOTE: I am working on the code of another programmer and I do not understand why he defined that structure, I would do it in another way but I can not alter the structure of the tables