Skip to content
Discussion options

You must be logged in to vote

In Program.cs in the client project you do this:

var proxyOptions = new Csla.Channels.Http.HttpProxyOptions();
builder.Services.AddTransient(typeof(IDataPortalProxy),
  sp =>
  {
    var applicationContext = sp.GetRequiredService<ApplicationContext>();
    var client = applicationContext.GetRequiredService<HttpClient>();
    return new CustomHttpProxy(applicationContext, client, proxyOptions);
  }); 

builder.Services.AddCsla(o => o
  .AddBlazorWebAssembly());

This is basically the code from the UseHttpProxy method that you'd normally, call. You are just implementing that code yourself in Program.cs.

Alternately, in the file where you implement your custom proxy, you can also declare an e…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@rockfordlhotka
Comment options

Answer selected by HaileMariamR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants