Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsakamoto/entityframeworkcore.indexattribute
Revival of [Index] attribute for EF Core. (with extension for model building.)
https://github.com/jsakamoto/entityframeworkcore.indexattribute
csharp efcore netcore
Last synced: 44 minutes ago
JSON representation
Revival of [Index] attribute for EF Core. (with extension for model building.)
- Host: GitHub
- URL: https://github.com/jsakamoto/entityframeworkcore.indexattribute
- Owner: jsakamoto
- License: mit
- Created: 2017-12-28T07:48:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T14:40:30.000Z (3 months ago)
- Last Synced: 2025-01-29T16:55:16.198Z (7 days ago)
- Topics: csharp, efcore, netcore
- Language: C#
- Homepage:
- Size: 151 KB
- Stars: 42
- Watchers: 5
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README-Appendix-D.md
- License: LICENSE
Awesome Lists containing this project
README
# IndexColumnAttribute for EntityFramework Core
## Appendix D - Upgrade an existing project
To upgrade an existing project that uses ver.3 or before to use ver.5 or later of this package:
1. Please confirm that the version of this package you use is ver.5 or later.```
PM> Update-Package Toolbelt.EntityFrameworkCore.IndexAttribute
```2. Remove `using Toolbelt.ComponentModel.DataAnnotations.Schema;`, and insert `using Toolbelt.ComponentModel.DataAnnotations.Schema.V5;` instead.
```csharp
...
// 👇 Remove this line...
// using Toolbelt.ComponentModel.DataAnnotations.Schema;// 👇 Insert this line, instead.
using Toolbelt.ComponentModel.DataAnnotations.Schema.V5;
...
```3. Replace `[Index]` attribute to `[IndexColumn]` attribute.
```csharp
...
public class Foo {
...
// 👇 Replace [Index] to [IndexColumn]
[IndexColumn]
public int Bar { get; set; }
...
```