© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•7mo ago•
6 replies
Pablitux

.Net Channels and MVVM

I have a Background Service that receives information from a websocket endpoint in JSON format and deserializes it into types I defined, based on the value of the JSON's "action" property. So far, so good; the service works, and I can correctly deserialize each type. However, I've run into a problem. To send information to the endpoint, I use a method that simply sends the action, which is structured the same way I receive it. Since I'm only sending the information, I need a way to receive this information and queue it to be deserialized and stored in memory. I immediately thought of using Channels, which seems to accomplish this goal. Now, I need to create consumer logic that receives this information and stores it in a context. When the Background Service receives a different state, it notifies the context to update the state of this class. From what I've read about MVVM, you can do this by storing the states in view models. However, I'm unsure if I understand correctly what MVVM is for or how to implement all this logic. Can anyone help me?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Trying to understand MVVM and MVC. Blazor ASP.NET
C#CC# / help
2y ago
❔ Choosing an MVVM Framework - Prism vs MvvmCross
C#CC# / help
4y ago
MVVM .net MAUI delete button not working
C#CC# / help
2y ago