-1
これは愚かな質問かもしれませんが、私はこのtutorielに従います。Ninjectモジュールを使用しようとしています
は、その後、私は、私はNinject
名「のバインド」を使用しています。この次のエラーを持って存在していません。
何が起こっているかここでは簡単な例
using Ninject.Modules;
using Ninject;
namespace WCFExampleLibrary.Services
{
public class IocServices : NinjectModule
{
public override void Load()
{
Bind<ICourseRepository>().To<CourseRepository>();
Bind<IStudentRepository>().To<StudentRepository>();
Bind<IEnrollementRepository>().To<EnrollementRepository>();
}
}
}
using System.Reflection;
using Ninject;
namespace WCFExampleLibrary.Services
{
public static class FactoryBuilder
{
private static IKernel _Kernal { get; set; }
public static T GetServices<T>()
{
_Kernal = new StandardKernel();
_Kernal.Load(Assembly.GetExecutingAssembly());
return _Kernal.Get<T>();
}
}
}
どうやって使用していますか?より多くのコードを見る必要があります。 –