BackgroundService - Is it possible to set parameter value?

Cenk 956 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,154 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,383 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,228 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,366 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