コード例 #1
0
ファイル: Startup.cs プロジェクト: dev-2-geek/Chat
 public async Task Any(PostObjectToChannel request)
 {
     if (request.ToUserId != null)
     {
         if (request.CustomType != null)
         {
             await ServerEvents.NotifyUserIdAsync(request.ToUserId, request.Selector ?? Selector.Id <CustomType>(), request.CustomType);
         }
         if (request.SetterType != null)
         {
             await ServerEvents.NotifyUserIdAsync(request.ToUserId, request.Selector ?? Selector.Id <SetterType>(), request.SetterType);
         }
     }
     else
     {
         if (request.CustomType != null)
         {
             await ServerEvents.NotifyChannelAsync(request.Channel, request.Selector ?? Selector.Id <CustomType>(), request.CustomType);
         }
         if (request.SetterType != null)
         {
             await ServerEvents.NotifyChannelAsync(request.Channel, request.Selector ?? Selector.Id <SetterType>(), request.SetterType);
         }
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: permadiwibisono/Test
 public void Any(PostObjectToChannel request)
 {
     if (request.ToUserId != null)
     {
         if (request.CustomType != null)
             ServerEvents.NotifyUserId(request.ToUserId, request.Selector ?? Selector.Id<CustomType>(), request.CustomType);
         if (request.SetterType != null)
             ServerEvents.NotifyUserId(request.ToUserId, request.Selector ?? Selector.Id<SetterType>(), request.SetterType);
     }
     else
     {
         if (request.CustomType != null)
             ServerEvents.NotifyChannel(request.Channel, request.Selector ?? Selector.Id<CustomType>(), request.CustomType);
         if (request.SetterType != null)
             ServerEvents.NotifyChannel(request.Channel, request.Selector ?? Selector.Id<SetterType>(), request.SetterType);
     }
 }