Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Composite Keys for User level tables #32

Closed
coni2k opened this issue May 24, 2015 · 2 comments
Closed

Use Composite Keys for User level tables #32

coni2k opened this issue May 24, 2015 · 2 comments

Comments

@coni2k
Copy link
Contributor

coni2k commented May 24, 2015

Remove Id field from UserResourcePool, UserElementFieldIndex, UserElementCell tables and use composite keys instead.

Composite key sample;

[Key]
[Column(Order = 1)]
public int LocationID { get; set; }

[Key]
[Column(Order = 2)]
public int DayID { get; set; }

@coni2k
Copy link
Contributor Author

coni2k commented May 24, 2015

OData V1-3 doesn't handle composite keys out of the box (or at least it looks like that).
OData V4 could be a solution, wait for #31

@coni2k
Copy link
Contributor Author

coni2k commented May 24, 2015

This was solved without upgrading to OData V4, by using a code from the following project;
http://aspnet.codeplex.com/SourceControl/changeset/view/9cb7243bd9fe3b2df484bf2409af943f39533588#Samples/WebApi/ODataCompositeKeySample/ReadMe.txt

It has a custom routing convention class, which worked fine. The good part is that userId doesn't have to be send to the server. It's only asking for the other key and completes the action.

@coni2k coni2k closed this as completed May 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant