Пример #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)
 {
 }