ソースを参照

update options configuration.

master
yangxiaodong 7年前
コミット
5583f6af7d
4個のファイルの変更6行の追加16行の削除
  1. +2
    -12
      src/DotNetCore.CAP.EntityFrameworkCore/CAP.EFOptions.cs
  2. +1
    -0
      src/DotNetCore.CAP.EntityFrameworkCore/CAP.Options.Extensions.cs
  3. +2
    -3
      src/DotNetCore.CAP.EntityFrameworkCore/SqlServerStorageConnection.cs
  4. +1
    -1
      src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs

+ 2
- 12
src/DotNetCore.CAP.EntityFrameworkCore/CAP.EFOptions.cs ファイルの表示

@@ -5,8 +5,7 @@ namespace DotNetCore.CAP
{
public class EFOptions
{
public const string DefaultSchema = "cap";
public const string DefaultMigrationsHistoryTableName = "__EFMigrationsHistory";
public const string DefaultSchema = "Cap";

/// <summary>
/// Gets or sets the schema to use when creating database objects.
@@ -15,17 +14,8 @@ namespace DotNetCore.CAP
public string Schema { get; set; } = DefaultSchema;

/// <summary>
/// Gets or sets the migrations history table's schema.
/// If this is null, <see cref="Schema"/> will be used.
/// EF dbcontext type.
/// </summary>
public string MigrationsHistoryTableSchema { get; set; }

/// <summary>
/// Gets or sets the migrations history table's name.
/// Default is <see cref="DefaultMigrationsHistoryTableName"/>.
/// </summary>
public string MigrationsHistoryTableName { get; set; } = DefaultMigrationsHistoryTableName;

public Type DbContextType { get; internal set; }
}
}

+ 1
- 0
src/DotNetCore.CAP.EntityFrameworkCore/CAP.Options.Extensions.cs ファイルの表示

@@ -40,6 +40,7 @@ namespace Microsoft.Extensions.DependencyInjection

var efOptions = new EFOptions { DbContextType = typeof(TContext) };
configure(efOptions);

options.RegisterExtension(new SqlServerCapOptionsExtension(configure));

return options;


+ 2
- 3
src/DotNetCore.CAP.EntityFrameworkCore/SqlServerStorageConnection.cs ファイルの表示

@@ -6,7 +6,6 @@ using Dapper;
using DotNetCore.CAP.Infrastructure;
using DotNetCore.CAP.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;

namespace DotNetCore.CAP.EntityFrameworkCore
{
@@ -14,9 +13,9 @@ namespace DotNetCore.CAP.EntityFrameworkCore
{
private readonly SqlServerOptions _options;

public SqlServerStorageConnection(IOptions<SqlServerOptions> options)
public SqlServerStorageConnection(SqlServerOptions options)
{
_options = options.Value;
_options = options;
}

public SqlServerOptions Options => _options;


+ 1
- 1
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs ファイルの表示

@@ -46,7 +46,7 @@ namespace DotNetCore.CAP.RabbitMQ

_connection = _connectionFactory.CreateConnection();
_channel = _connection.CreateModel();
_channel.ExchangeDeclare(exchange: _exchageName, type: _rabbitMQOptions.ExchangeType);
_channel.ExchangeDeclare(exchange: _exchageName, type: RabbitMQOptions.ExchangeType);
_channel.QueueDeclare(_queueName, exclusive: false);
}



読み込み中…
キャンセル
保存