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

Support an [Index] attribute #4050

Open
rowanmiller opened this issue Dec 11, 2015 · 9 comments
Open

Support an [Index] attribute #4050

rowanmiller opened this issue Dec 11, 2015 · 9 comments

Comments

@rowanmiller
Copy link
Member

@rowanmiller rowanmiller commented Dec 11, 2015

We didn't bring this over from EF6.x because it had a lot of issues... but opening this issue to track the possibility of adding it in the future since a number of folks have asked for it (see discussion on #1698).

@jsakamoto

This comment has been minimized.

Copy link

@jsakamoto jsakamoto commented Mar 20, 2018

We didn't bring this over from EF6.x because it had a lot of issues...

I'm not sure about what problems are there due to I had not learned more about it. Anyway, I could not forget Index attribute...

So that, I create my own Index attribute library, and published it.

https://www.nuget.org/packages/Toolbelt.EntityFrameworkCore.IndexAttribute

This library allows us to easy way to recognize models without round trip between DbContext class and Entity classes.

I hope, this library to be useful for some people who could not forget Index attribute, and I hope it does not bother the developer community.

@rockstardev

This comment has been minimized.

Copy link

@rockstardev rockstardev commented Jun 20, 2018

LOL @ "because it had lot of issues". Thanks for providing solution @jsakamoto

Inception when I see #1698

@davidrevoledo

This comment has been minimized.

Copy link

@davidrevoledo davidrevoledo commented Oct 31, 2018

@jsakamoto awesome !

@CZEMacLeod

This comment has been minimized.

Copy link

@CZEMacLeod CZEMacLeod commented Feb 1, 2019

It would be really nice to move/add IndexAttribute to the System.ComponentModel.Annotations or Microsoft.EntityFrameworkCore.Abstractions package, and align the attribute for EFCore vNext and EF6.3 to allow the use of annotations on the model, without forcing an ORM provider.

This would allow for migrating our existing app piecemeal, and re-using the model both server side (ASP.NET MVC5/WebAPI2/EF6) and in our offline client side apps (Xamarin.Forms)

Right now we are using a home grown solution similar to @jsakamoto's Toolbelt.EntityFrameworkCore.IndexAttribute but with our own abstractions package, an EF6 Convention in another package, and an EFCore ModelBuilder 'convention' in a third.

@roji

This comment has been minimized.

Copy link
Member

@roji roji commented Feb 1, 2019

@CZEMacLeod we definitely intend to have an attribute-based method to define indices in EF Core, but it's unlikely this would reuse the IndexAttribute found in System.ComponentModel.Annotations or be the same across EF6 and EF Core. Among other things, that attribute has the SQL Server-specific property IsClustered(), and we're looking at more usable ways to define composite indices. But no decisions have been made yet.

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Feb 1, 2019

@CZEMacLeod Also, the design of the Index attribute in EF6 is not very good, but we're not going to change it for EF6, so Core will definitely have a new attribute.

@weitzhandler

This comment has been minimized.

Copy link
Contributor

@weitzhandler weitzhandler commented Feb 2, 2019

Would be nice to have an IsUnique modifier too.

@ajcvickers ajcvickers removed this from the 3.0.0 milestone May 10, 2019
@ajcvickers ajcvickers added this to the Backlog milestone May 10, 2019
@tidusjar

This comment has been minimized.

Copy link

@tidusjar tidusjar commented Jun 18, 2019

I know you guys are super busy and have a lot of work to do at the moment but can someone please expand why this was taken out of the 3.0 release? Any idea when it might be placed in a different release?

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Jun 18, 2019

@tidusjar It was taken out because we don't have enough resources to complete it in time for 3.0. We will re-assess the backlog following the 3.0 release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.