Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Key Attribute on Tickets model #8

Closed
devinrader opened this issue Oct 15, 2015 · 2 comments
Closed

Key Attribute on Tickets model #8

devinrader opened this issue Oct 15, 2015 · 2 comments

Comments

@devinrader
Copy link

Does this need a Key attribute applied:

https://github.com/TwilioDevEd/browser-calls-csharp/blob/master/BrowserCalls.Web/Models/Ticket.cs#L8

@acamino
Copy link
Contributor

acamino commented Oct 15, 2015

Key attribute is not mandatory when you're defining a model, Key attribute is optional in this case. Whenever you define an Id attribute, then EF is smart enough to use that field as the primary key.

@devinrader
Copy link
Author

Ah, right. I never just use Id as the key property name, but its legit to do that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants