To upgrade an existing project that uses ver.3 or before to use ver.5 or later of this package:
- Please confirm that the version of this package you use is ver.5 or later.
PM> Update-Package Toolbelt.EntityFrameworkCore.IndexAttribute
- Remove
using Toolbelt.ComponentModel.DataAnnotations.Schema;
, and insertusing Toolbelt.ComponentModel.DataAnnotations.Schema.V5;
instead.
...
// 👇 Remove this line...
// using Toolbelt.ComponentModel.DataAnnotations.Schema;
// 👇 Insert this line, instead.
using Toolbelt.ComponentModel.DataAnnotations.Schema.V5;
...
- Replace
[Index]
attribute to[IndexColumn]
attribute.
...
public class Foo {
...
// 👇 Replace [Index] to [IndexColumn]
[IndexColumn]
public int Bar { get; set; }
...