Skip to content
Discussion options

You must be logged in to vote

Changing Worker.cs to this works. Seems cheesy, though. DI passes in IServiceProvider, I CreateScope() and grab the ServiceProvider off of it. THEN I can use the dataportal.

meh.

using Csla;
using Csla.Configuration;
using Csla.Runtime;

namespace BlazorApp.Worker
{
    public class Worker : BackgroundService
    {
        private IServiceProvider _provider;

        public Worker(ILogger<Worker> logger, IServiceProvider p)
        {
            _provider = p.CreateScope().ServiceProvider;

            var works = _provider.GetService<IDataPortal<BlazorApp1.Shared.PersonEdit>>();
            var bo = works.Create();
        }

        protected override async Task ExecuteAsync(Cancellatio…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lwmorris067
Comment options

@rockfordlhotka
Comment options

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