Skip to content

Commit

Permalink
[#227] [add] Controller2Factory impl
Browse files Browse the repository at this point in the history
  • Loading branch information
i4004 committed Feb 1, 2024
1 parent c3e3a1c commit 73bef68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Simplify.Web/Controller2Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ public abstract class Controller2Base : ResponseShortcutsControllerBase
/// <value>
/// The string table.
/// </value>
public virtual IDictionary<string, object> StringTable { get; internal set; } = null!;
public virtual IDictionary<string, object?> StringTable { get; internal set; } = null!;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using Simplify.DI;
using Simplify.Web.Core.AccessorsBuilding;
using Simplify.Web.Modules.Data;

namespace Simplify.Web.Core.Controllers.Execution;

Expand All @@ -15,6 +17,12 @@ public class Controller2Factory : ActionModulesAccessorBuilder, IController2Fact
/// <returns>The controller.</returns>
public ResponseShortcutsControllerBase CreateController(IControllerExecutionArgs args)
{
throw new NotImplementedException();
var controller = (Controller2Base)args.Resolver.Resolve(args.ControllerMetaData.ControllerType);

BuildActionModulesAccessorProperties(controller, args.Resolver);

controller.StringTable = args.Resolver.Resolve<IStringTable>().Items;

return controller;
}
}

0 comments on commit 73bef68

Please sign in to comment.