コード例 #1
0
        public override void Configure(IModuleBuilder moduleBuilder)
        {
            moduleBuilder.Dependencies.AddSingleton <PermissionService>();
            moduleBuilder.Dependencies.AddSingleton(() => new Authorization());

            moduleBuilder.AddHandler <TokenHandler, TokenMessage>();
            moduleBuilder.AddHandler <PermissionHandler, object>("*");
            moduleBuilder.AddHandler <LoginHandler, LoginMessage>();
        }
コード例 #2
0
 public static void AddCollection <TCollection, TDocument>(this IModuleBuilder builder, string collection)
     where TCollection : Collection <TDocument>, new()
     where TDocument : Document
 {
     builder.AddHandler <CreateDocumentHandler <TDocument>, CreateDocument <TDocument> >($"data.create.{collection}");
     builder.AddHandler <UpdateDocumentHandler <TDocument>, UpdateDocument <TDocument> >($"data.update.{collection}");
     builder.AddHandler <DeleteDocumentHandler <TDocument>, DeleteDocument <TDocument> >($"data.delete.{collection}");
     builder.AddHandler <ReadDocumentHandler <TDocument>, ReadDocument <TDocument> >($"data.read.{collection}");
 }
コード例 #3
0
        public override void Configure(IModuleBuilder builder)
        {
            builder.AddHandler <ValidationHandler, object>("*");

            builder.AddHandler <LengthHandler, ValidationMessage <Length> >();
        }
コード例 #4
0
ファイル: DataModule.cs プロジェクト: no0dles/dotnet-abox
        public override void Configure(IModuleBuilder builder)
        {
            builder.Dependencies.AddSingleton <DataService>();

            builder.AddHandler <AuthorizationHandler, object>("*");
        }