我有一個非常簡單的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