protected EventDetailsBaseModule(string modulePath
                                         , IEventCrudQueries <TEntity, TKey> queries
                                         , ICrudCommands <TEntity, TKey> commands
                                         , IValidator <TEntity> validator)
            : base("api/events/{eventId}/" + modulePath)
        {
            this.Before.AddItemToEndOfPipeline(ctx =>
            {
                _user = (IIdentity)ctx.CurrentUser;
                return(null);
            });

            this.RequiresAuthentication();
            this.RequiresClaims("User");

            _queries   = queries;
            _commands  = commands;
            _validator = validator;

            Get["/"]        = _ => GetAll();
            Get["/{id}"]    = p => GetById(p.Id);
            Post["/"]       = _ => Create();
            Put["/"]        = _ => Update();
            Delete["/{id}"] = p => Remove(p.Id);
        }