我有一个非常简单的Ninject绑定:传递参数方法结合
Bind<ISessionFactory>().ToMethod(x =>
{
return Fluently.Configure()
.Database(SQLiteConfiguration.Standard
.UsingFile(CreateOrGetDataFile("somefile.db")).AdoNetBatchSize(128))
.Mappings(
m => m.FluentMappings.AddFromAssembly(Assembly.Load("Sauron.Core"))
.Conventions.Add(PrimaryKey.Name.Is(p => "Id"), ForeignKey.EndsWith("Id")))
.BuildSessionFactory();
}).InSingletonScope();
我需要的是更换“somefile.db”与争论。类似的东西
kernel.Get<ISessionFactory>("somefile.db");
我该如何做到这一点?
@nemsev非常感谢你:) – Davita