BackgroundService - Is it possible to set parameter value?

Cenk 1,001 Reputation points
2023-02-02T16:43:45.4+00:00

Hi,

I have a background service. I wonder if it is possible to set a parameter to this service from the Blazor Server application or in any other way?

Thank you in advance.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,553 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,575 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,906 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 64,901 Reputation points
    2023-02-02T18:45:27.95+00:00

    if the background service is in the same application, then just use a shared collection (queue):

    https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent.concurrentqueue-1?view=net-7.0

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.