protected virtual void ConfigureProperty(IMutableProperty property, string configuration, string value) { var propertyAnnotations = property.SqlServer(); switch (configuration) { case nameof(RelationalPropertyAnnotations.DefaultValue): property.ValueGenerated = ValueGenerated.OnAdd; propertyAnnotations.DefaultValue = int.Parse(value); break; case nameof(RelationalPropertyAnnotations.DefaultValueSql): property.ValueGenerated = ValueGenerated.OnAdd; propertyAnnotations.DefaultValueSql = value; break; case nameof(RelationalPropertyAnnotations.ComputedColumnSql): property.ValueGenerated = ValueGenerated.OnAddOrUpdate; propertyAnnotations.ComputedColumnSql = value; break; case nameof(SqlServerPropertyAnnotations.ValueGenerationStrategy): property.ValueGenerated = ValueGenerated.OnAdd; propertyAnnotations.ValueGenerationStrategy = SqlServerValueGenerationStrategy.IdentityColumn; break; default: throw new NotImplementedException(); } }
protected virtual void ConfigureProperty(IMutableProperty property, string configuration, string value) { var propertyAnnotations = property.SqlServer(); switch (configuration) { case nameof(RelationalPropertyAnnotations.DefaultValue): property.ValueGenerated = ValueGenerated.OnAdd; propertyAnnotations.DefaultValue = int.Parse(value); break; case nameof(RelationalPropertyAnnotations.DefaultValueSql): property.ValueGenerated = ValueGenerated.OnAdd; propertyAnnotations.DefaultValueSql = value; break; case nameof(RelationalPropertyAnnotations.ComputedColumnSql): property.ValueGenerated = ValueGenerated.OnAddOrUpdate; propertyAnnotations.ComputedColumnSql = value; break; case nameof(SqlServerPropertyAnnotations.ValueGenerationStrategy): property.ValueGenerated = ValueGenerated.OnAdd; propertyAnnotations.ValueGenerationStrategy = SqlServerValueGenerationStrategy.IdentityColumn; break; default: throw new NotImplementedException(); } }