BackgroundService - Is it possible to set parameter value?

Cenk 1,051 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.

Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | .NET | Blazor
Developer technologies | C#
Developer technologies | 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.
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 82,686 Reputation points Volunteer Moderator
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.