Namespace Eco.Core.Serialization.Migrations.Attributes
Classes
MigratedTypeAttribute
MigrationAttribute
MigrationTypeAttribute
Attribute for marking class as MigrationType (read more about migration types in the MigrationType documentation). Can be used in two ways:
- As SerializedAttribute type attribute, then the attributed type will be used to represent new type if MigrationType not specified. The representing type shouldn't exactly match target type, but only have necessary fields. This type may not even existing in final schema, but used as intermediate type (i.e. if you have Schema v1 with type Foo and need to migrate to Schema v3 with type Baz, but in Schema v2 type Foo was renamed to Bar and then to Baz in v3. In this case you may need to migrate first to MigrationType("Bar", SinceVersion=2) and then you will be able to migrate from Bar to Baz for version v3).
- As migration class attribute (the type with MigrationAttribute). In most cases when used with migration TargetSchemaType is same as MigrationType as well as SinceVersion. In that cases you can just use constructor with type parameter which sets MigrationType to same value as TargetSchemaType and SinceVersion will be used from MigrationAttribute. It will help to avoid copy paste and potential errors when these values changes not synced.