0
jcspader created
I'd like to know if using ASP.NET Boilerplate with EF, is it possible:
Use the composive Primary Key in EF. I have seen many samples with only one column in TPrimaryKey in Repository.
The column's name of Primary Key is required call "Id".
I searched online, but I can't find the answer.
1 Answer(s)
-
0
Hi My answers;
- Use the composive Primary Key in EF. I have seen many samples with only one column in TPrimaryKey in Repository.
- As Entity Framework allows Composite Primary Keys, ABP has also allows it.
[Column(Order = 1), Key, ForeignKey("MyForeignKey")] public int Field1 { get; set; } [Column(Order = 2), Key, ForeignKey("MyForeignKey")] public string Field2 { get; set; }
- The column's name of Primary Key is required call "Id".
Id column is required to use some rich features with IRepository<T>... If you don't want to use ABP's built-in repository features then there's no requirement for Id field.