Skip to content
Discussion options

You must be logged in to vote

There are a couple ways to do the calling code, depending on whether you have DI configured. I would recommend that you do configure DI, and then use a service locator pattern, so that's what I'll discuss here.

First, in app startup, ensure DI is configured, and UseCsla is called. Also register your factory types.

  // startup code
  services.AddCsla();
  services.AddTransient<PersonEdit.Factory>();
  // ...
  // once you've created the service provider, set your static service locator property
  App.ServiceProvider = provider;

Then, in your App class (or other globally available type) implement the service locator pattern:

  public static ServiceProvider ServiceProvider { get; set; }

The…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JacoJordaan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants