© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
9 replies
SWEETPONY

✅ Is it possible to use grouping here?

I have following logic:
foreach (var argument in arguments.Items)
{
    var messageDto = new MessageDto
    {
         Timestamp = DateTimeOffset.Now,
         Title = "", // think about this
         Content = argument.Event.ToJsonString(), // fix this
         Behavior = argument.Behavior,
         To = await GetSubjectsAddresses(
            channelName: argument.ChannelName,
            subjects: subjectsQueryResponse
                 .Where(subjectDto => argument.SubjectIds
                       .Contains(subjectDto.Id)),
            channelSettings: channelSettings)
     };

   await _messagingChannelsClient.MessagesSend(new(argument.ChannelName, new[] { messageDto }) );
foreach (var argument in arguments.Items)
{
    var messageDto = new MessageDto
    {
         Timestamp = DateTimeOffset.Now,
         Title = "", // think about this
         Content = argument.Event.ToJsonString(), // fix this
         Behavior = argument.Behavior,
         To = await GetSubjectsAddresses(
            channelName: argument.ChannelName,
            subjects: subjectsQueryResponse
                 .Where(subjectDto => argument.SubjectIds
                       .Contains(subjectDto.Id)),
            channelSettings: channelSettings)
     };

   await _messagingChannelsClient.MessagesSend(new(argument.ChannelName, new[] { messageDto }) );


I would like to use
MessagesSend
MessagesSend
like that:
await _messagingChannelsClient.MessagesSend(new(groupKey, messages) )
await _messagingChannelsClient.MessagesSend(new(groupKey, messages) )
;

it is unpossible because of await in object. So how to fix it?
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

Is it possible to use pattern matching here?
C#CC# / help
15mo ago
✅ Is it worth to use stackalloc here?
C#CC# / help
16mo ago
✅ Is it possible to use nameof in attributes?
C#CC# / help
3y ago
✅ Is it possible to use union type in C#?
C#CC# / help
3y ago