diff --git a/src/EFCore.Jet/Design/Internal/JetAnnotationCodeGenerator.cs b/src/EFCore.Jet/Design/Internal/JetAnnotationCodeGenerator.cs index 8f95420..cf6377a 100644 --- a/src/EFCore.Jet/Design/Internal/JetAnnotationCodeGenerator.cs +++ b/src/EFCore.Jet/Design/Internal/JetAnnotationCodeGenerator.cs @@ -1,60 +1,53 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using EntityFrameworkCore.Jet.Metadata; using EntityFrameworkCore.Jet.Metadata.Internal; +using EntityFrameworkCore.Jet.Utilities; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore.Design; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using EntityFrameworkCore.Jet.Utilities; namespace EntityFrameworkCore.Jet.Design.Internal { + /// + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// any release. You should only use it directly in your code with extreme caution and knowing that + /// doing so can result in application failures when updating to a new Entity Framework Core release. + /// public class JetAnnotationCodeGenerator : AnnotationCodeGenerator { + /// + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// any release. You should only use it directly in your code with extreme caution and knowing that + /// doing so can result in application failures when updating to a new Entity Framework Core release. + /// public JetAnnotationCodeGenerator([NotNull] AnnotationCodeGeneratorDependencies dependencies) : base(dependencies) { } + /// + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// any release. You should only use it directly in your code with extreme caution and knowing that + /// doing so can result in application failures when updating to a new Entity Framework Core release. + /// public override bool IsHandledByConvention(IModel model, IAnnotation annotation) { Check.NotNull(model, nameof(model)); Check.NotNull(annotation, nameof(annotation)); + // CHECK: Jet default schema handling. if (annotation.Name == RelationalAnnotationNames.DefaultSchema) - return true; - - return false; - } - - public override MethodCallCodeFragment GenerateFluentApi(IKey key, IAnnotation annotation) - { - Check.NotNull(key, nameof(key)); - Check.NotNull(annotation, nameof(annotation)); - - if (annotation.Name == JetAnnotationNames.Clustered) - { - return (bool)annotation.Value == false - ? new MethodCallCodeFragment(nameof(JetIndexBuilderExtensions.ForJetIsClustered), false) - : new MethodCallCodeFragment(nameof(JetIndexBuilderExtensions.ForJetIsClustered)); - } - - return null; - } - - public override MethodCallCodeFragment GenerateFluentApi(IIndex index, IAnnotation annotation) - { - Check.NotNull(index, nameof(index)); - Check.NotNull(annotation, nameof(annotation)); - - if (annotation.Name == JetAnnotationNames.Clustered) { - return (bool)annotation.Value == false - ? new MethodCallCodeFragment(nameof(JetIndexBuilderExtensions.ForJetIsClustered), false) - : new MethodCallCodeFragment(nameof(JetIndexBuilderExtensions.ForJetIsClustered)); + return string.Equals("dbo", (string)annotation.Value); } - return null; + return annotation.Name == JetAnnotationNames.ValueGenerationStrategy + && (JetValueGenerationStrategy)annotation.Value == JetValueGenerationStrategy.IdentityColumn; } } -} +} \ No newline at end of file diff --git a/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs b/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs index 178d4e6..0bb3fc0 100644 --- a/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs +++ b/src/EFCore.Jet/Design/Internal/JetDesignTimeServices.cs @@ -1,8 +1,10 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using EntityFrameworkCore.Jet.Diagnostics.Internal; using EntityFrameworkCore.Jet.Scaffolding.Internal; using EntityFrameworkCore.Jet.Storage.Internal; using Microsoft.EntityFrameworkCore.Design; +using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Scaffolding; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.Extensions.DependencyInjection; @@ -10,20 +12,25 @@ using Microsoft.Extensions.DependencyInjection; namespace EntityFrameworkCore.Jet.Design.Internal { /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// any release. You should only use it directly in your code with extreme caution and knowing that + /// doing so can result in application failures when updating to a new Entity Framework Core release. /// public class JetDesignTimeServices : IDesignTimeServices { /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// any release. You should only use it directly in your code with extreme caution and knowing that + /// doing so can result in application failures when updating to a new Entity Framework Core release. /// public virtual void ConfigureDesignTimeServices(IServiceCollection serviceCollection) => serviceCollection + .AddSingleton() .AddSingleton() .AddSingleton() .AddSingleton() .AddSingleton(); } -} +} \ No newline at end of file