Commit 5583f6af authored by yangxiaodong's avatar yangxiaodong

update options configuration.

parent 9acccdae
......@@ -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; }
}
}
\ No newline at end of file
......@@ -40,6 +40,7 @@ namespace Microsoft.Extensions.DependencyInjection
var efOptions = new EFOptions { DbContextType = typeof(TContext) };
configure(efOptions);
options.RegisterExtension(new SqlServerCapOptionsExtension(configure));
return options;
......
......@@ -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;
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment