Example #1
0
        public static DbContextOptionsBuilder UseVfp(
            [NotNull] this DbContextOptionsBuilder optionsBuilder,
            [AllowNull] Action <VfpDbContextOptionsBuilder> vfpOptionsAction = null
            )
        {
            optionsBuilder.ThrowIfNull(nameof(optionsBuilder));

            ((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(GetOrCreateExtension(optionsBuilder));

            vfpOptionsAction?.Invoke(new VfpDbContextOptionsBuilder(optionsBuilder));

            return(optionsBuilder);
        }
Example #2
0
        public static DbContextOptionsBuilder UseVfp(
            [NotNull] this DbContextOptionsBuilder optionsBuilder,
            [NotNull] string connectionString,
            [AllowNull] Action <VfpDbContextOptionsBuilder> vfpOptionsAction = null
            )
        {
            optionsBuilder.ThrowIfNull(nameof(optionsBuilder));
            connectionString.ThrowIfNull(nameof(connectionString));

            var extension = (VfpOptionsExtension)GetOrCreateExtension(optionsBuilder).WithConnectionString(connectionString);

            ((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(extension);

            vfpOptionsAction?.Invoke(new VfpDbContextOptionsBuilder(optionsBuilder));

            return(optionsBuilder);
        }