digipolisantwerp / dataaccess_aspnetcore_deprecated

Generic repository/unit of work framework for ASP.NET Core with Entity Framework.
Other
140 stars 45 forks source link

Primary key data type other than integer #28

Closed pkapare closed 7 years ago

pkapare commented 7 years ago

Hi, I liked this library very much. Thanks for good work. I have question though. Currently EntityBase class in library is defined as follows. public class EntityBase { [Key] public int Id { get; set; } }

What if I need to use different Key i.e. GUID as key or instead of "Id" name use different Key e.g. "UserId". Is there any way I can override data type and name of Key property here? If not name then at least data type? Regards Pankaj

StevenVandenBroeck commented 7 years ago

That's not possible right now with this library. What you can do is fork the repository and change the EntityBase class for yourself.