예제 #1
0
 public MySqlValueGeneratorSelector(
     [NotNull] IValueGeneratorCache cache,
     [NotNull] IRelationalAnnotationProvider relationalExtensions,
     [NotNull] IRelationalTypeMapper typeMapper)
     : base(cache, relationalExtensions)
 {
     _mySqlTypeMapper = typeMapper as MySqlScopedTypeMapper;
 }
        public RelationalValueGeneratorSelector(
            [NotNull] IValueGeneratorCache cache,
            [NotNull] IRelationalAnnotationProvider relationalExtensions)
            : base(cache)
        {
            Check.NotNull(relationalExtensions, nameof(relationalExtensions));

            RelationalExtensions = relationalExtensions;
        }
 public NpgsqlValueGeneratorSelector(
     [NotNull] IValueGeneratorCache cache,
     [NotNull] INpgsqlSequenceValueGeneratorFactory sequenceFactory,
     [NotNull] NpgsqlRelationalConnection connection,
     [NotNull] IRelationalAnnotationProvider relationalExtensions)
     : base(cache, relationalExtensions)
 {
     _sequenceFactory = sequenceFactory;
     _connection      = connection;
 }
예제 #4
0
        public static void ResetValueGenerators(this DbContext context)
        {
            IValueGeneratorCache cache = context.GetService <IValueGeneratorCache>();

            foreach (IProperty keyProperty in context.Model.GetEntityTypes()
                     .Select(e => e.FindPrimaryKey().Properties[0])
                     .Where(p => p.ClrType == typeof(int) &&
                            p.ValueGenerated == ValueGenerated.OnAdd))
            {
                ResettableValueGenerator generator = (ResettableValueGenerator)cache.GetOrAdd(
                    keyProperty,
                    keyProperty.DeclaringEntityType,
                    (p, e) => new ResettableValueGenerator());

                generator.Reset();
            }
        }
예제 #5
0
 public TestInMemoryValueGeneratorSelector(IValueGeneratorCache cache)
     : base(cache)
 {
 }
        /// <summary>
        ///     Initializes a new instance of the <see cref="ValueGeneratorSelector"/> class.
        /// </summary>
        /// <param name="cache"> The cache to be used to store value generator instances. </param>
        public ValueGeneratorSelector([NotNull] IValueGeneratorCache cache)
        {
            Check.NotNull(cache, nameof(cache));

            Cache = cache;
        }
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="cache"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public ValueGeneratorSelectorDependencies With([NotNull] IValueGeneratorCache cache)
 => new ValueGeneratorSelectorDependencies(cache);
        public ValueGeneratorSelectorDependencies([NotNull] IValueGeneratorCache cache)
        {
            Check.NotNull(cache, nameof(cache));

            Cache = cache;
        }
예제 #9
0
 /// <summary>
 ///     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.
 /// </summary>
 public InMemoryValueGeneratorSelector([NotNull] IValueGeneratorCache cache)
     : base(cache)
 {
 }
 public FileContextValueGeneratorSelector(IValueGeneratorCache cache) : base(cache)
 {
     genFactory = new FileContextIntegerValueGeneratorFactory();
 }
예제 #11
0
 public TestInMemoryValueGeneratorSelector(IValueGeneratorCache cache)
     : base(cache)
 {
 }
예제 #12
0
 public RelationalValueGeneratorSelector([NotNull] IValueGeneratorCache cache)
     : base(cache)
 {
 }
 public CustomInMemoryValueGeneratorSelector(IValueGeneratorCache cache)
     : base(cache)
 {
 }
예제 #14
0
 public MySqlValueGeneratorSelector(
     [NotNull] IValueGeneratorCache cache,
     [NotNull] IRelationalAnnotationProvider relationalExtensions)
     : base(cache, relationalExtensions)
 {
 }