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>(); }
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}"); }
public override void Configure(IModuleBuilder builder) { builder.AddHandler <ValidationHandler, object>("*"); builder.AddHandler <LengthHandler, ValidationMessage <Length> >(); }
public override void Configure(IModuleBuilder builder) { builder.Dependencies.AddSingleton <DataService>(); builder.AddHandler <AuthorizationHandler, object>("*"); }