コード例 #1
0
    public EmployeeGroup(AppApiGroup source)
        : base(source)
    {
        var actions = new WebAppApiActionFactory(source);

        Index       = source.AddAction(actions.DefaultView());
        AddEmployee = source.AddAction
                      (
            actions.Action
            (
                nameof(AddEmployee),
                () => new AddEmployeeValidation(),
                () => new AddEmployeeAction()
            )
                      );
        AddEmployeeFormView = source.AddAction
                              (
            actions.PartialView
            (
                nameof(AddEmployeeFormView),
                () => new AddEmployeeFormViewAction()
            )
                              );
        AddEmployeeForm = source.AddAction
                          (
            actions.Action
            (
                nameof(AddEmployeeForm),
                () => new AddEmployeeFormAction()
            )
                          );
        Employee = source.AddAction
                   (
            actions.Action
            (
                nameof(Employee),
                () => new EmployeeAction(),
                "Get Employee Information"
            )
                   );
    }
コード例 #2
0
ファイル: AuthGroup.cs プロジェクト: JasonBenfield/HubWebApp
        public AuthGroup(AppApiGroup source, AuthActionFactory actionFactory)
            : base(source)
        {
            var actions = new WebAppApiActionFactory(source);

            Index       = source.AddAction(actions.DefaultView());
            VerifyLogin = source.AddAction
                          (
                actions.Action
                (
                    nameof(VerifyLogin),
                    actionFactory.CreateVerifyLoginAction
                )
                          );
            VerifyLoginForm = source.AddAction
                              (
                actions.PartialView
                (
                    nameof(VerifyLoginForm),
                    () => new PartialViewAppAction <EmptyRequest>(nameof(VerifyLoginForm))
                )
                              );
            Login = source.AddAction
                    (
                actions.Action
                (
                    nameof(Login),
                    () => new LoginModelValidation(),
                    actionFactory.CreateLoginAction
                )
                    );
            Logout = source.AddAction
                     (
                actions.Action
                (
                    nameof(Logout),
                    actionFactory.CreateLogoutAction
                )
                     );
        }