Questions tagged [controller-factory]

30 questions
43
votes
5 answers

Best place to set CurrentCulture for multilingual ASP.NET MVC web applications

For multilingual ASP.NET MVC 3 web application, I am determining the Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture on the controller factory as follows: public class MyControllerFactory : DefaultControllerFactory { …
tugberk
  • 57,477
  • 67
  • 243
  • 335
10
votes
1 answer

JavaFX custom controller factory

I have been experimenting with the FXMLLoader and using the setControllerFactory method using a custom Callback implementation. The ORACLE documentation says the following: An implementation might return a null value to indicate that it does …
Benjamin Gale
  • 12,977
  • 6
  • 62
  • 100
6
votes
2 answers

ControllerFactory for specific portable area

My main ASP.NET MVC composite application uses a global Unity container to register types. The app sets the controller factory up to use this global container. I would like to refactor this such that each one of my portable areas leverages it's own…
4
votes
1 answer

Implementing Custom Controller Factory involving multiple Assemblies

Currently, we are trying to implement a custom Controller Factory in our API to determine the correct controller to be used depending on an identifier token that is passed in to our API. The way this project is setup is that each different company…
2
votes
2 answers

How do I get Web API / Castle Windsor to recognize a Controller?

I found out why the placeholder "Home Controller" was getting called here I commented out the reference to HomeController in RouteConfig.cs and added a Controller that I want it to call instead: public class RouteConfig { public static void…
2
votes
1 answer

How do I set a custom controller factory in Orchard?

Can those more familiar with Orchard CMS help me with a problem? I am writing an Orchard module and my controllers have constructor arguments (service interfaces). Where in Orchard do I set up a custom controller factory to handle this (without…
2
votes
1 answer

Resolving named registration using Unity 2 in DefaultControllerFactory

I have an issue with resolving named registrations of registered types in Unity 2 using ASP.NET MVC 3 with DI set in DefaultControllerFactory. In one assembly I have defined Unity container with registration types and named registrations public…
civan
  • 254
  • 3
  • 9
2
votes
1 answer

MVC 3 get ActionResult of an action that is defined on a different controller

Problem: What I need is something similar to @Html.RenderAction("action","controller") , but one that I can use from inside a different controller. This for example: public class FirstController : Controller { public ActionResult GetErDone() …
1
vote
1 answer

If you are starting a new MVC3 project which adaption will you choose DependencyResolver or ControllerFactory with Castle Windsor?

I am new to the ioc containers and confused how to integrate a container to mvc3... There is a sample that uses ControllerFactory... https://github.com/kkozmic/ToBeSeen/blob/master/src/ToBeSeen/Plumbing/WindsorControllerFactory.cs There is a blog…
Serdar
  • 1,416
  • 2
  • 17
  • 43
1
vote
1 answer

MVC3 / Structure Map 2.6.2 DI custom controller factory problem

I'm having problems with passing non-parameterless classes as models to a view in a controller. I recently moved from Structure Map 2.5.3 to 2.6.2. Everything worked fine in 2.5.3 nad it doesn't work anymore in 2.6.2. Here is my Custom Controller…
1
vote
1 answer

ASP.NET Core 3 - Overriding the default ControllerFactory on custom, how save it call in else cases?

How to override the default realization IControllerFactory with a custom factory for custom cases one and keep calling DefaultControllerFactory in normal cases if DefaultControllerFactory has become an inner class in ASP.NET Core…
1
vote
2 answers

ASP.NET MVC 3 + Unity injection of the Controller

Which event is the best for registering the types with Unity? I wish to do this iocContainer.RegisterType(); iocContainer.RegisterType(); so they could be retrieved by the ControllerFactory from the Unity…
1
vote
1 answer

Custom ControllerFactory does not replace DefaultControllerFactory when there is a controller collision

I have a custom controller factory (very basic implementation that is relevant to my question): public class MyControllerFactory : DefaultControllerFactory { public override IController CreateController(RequestContext requestContext, string…
Kyle Trauberman
  • 25,414
  • 13
  • 85
  • 121
1
vote
2 answers

What is the correct place to dispose a repository created in a custom controller factory?

In my ASP.NET MVC project I use a custom controller factory that instantiates an Entity Framework-based data repository and passes it to the controller's constructor. The repository object implements IDisposable, but where should I call its Dispose…
1
vote
1 answer

Custom ControllerFactory with autofac

First of all i am a newbie in asp mvc so please be patient. Currently I want to create project where autofac will be IoC container i will reqister custom controller factory. In custom controller factory I want to set implementation Data Repository…
1
2