-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathICacheExt.cs
More file actions
37 lines (28 loc) · 2.35 KB
/
ICacheExt.cs
File metadata and controls
37 lines (28 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using StreamVideo.v1.Sfu.Models;
using StreamVideo.Core.InternalDTO.Models;
using StreamVideo.Core.InternalDTO.Responses;
using StreamVideo.Core.StatefulModels;
namespace StreamVideo.Core.State.Caches
{
internal static class ICacheExt
{
public static StreamCall TryCreateOrUpdate(this ICache cache, CallResponseInternalDTO dto)
=> dto == null ? null : cache.Calls.CreateOrUpdate<StreamCall, CallResponseInternalDTO>(dto, out _);
public static StreamCall TryCreateOrUpdate(this ICache cache, GetCallResponseInternalDTO dto)
=> dto == null ? null : cache.Calls.CreateOrUpdate<StreamCall, GetCallResponseInternalDTO>(dto, out _);
public static StreamCall TryCreateOrUpdate(this ICache cache, GetOrCreateCallResponseInternalDTO dto)
=> dto == null ? null : cache.Calls.CreateOrUpdate<StreamCall, GetOrCreateCallResponseInternalDTO>(dto, out _);
public static StreamCall TryCreateOrUpdate(this ICache cache, JoinCallResponseInternalDTO dto)
=> dto == null ? null : cache.Calls.CreateOrUpdate<StreamCall, JoinCallResponseInternalDTO>(dto, out _);
public static StreamCall TryCreateOrUpdate(this ICache cache, CallStateResponseFieldsInternalDTO dto)
=> dto == null ? null : cache.Calls.CreateOrUpdate<StreamCall, CallStateResponseFieldsInternalDTO>(dto, out _);
public static StreamVideoUser TryCreateOrUpdate(this ICache cache, UserResponseInternalDTO dto)
=> dto == null ? null : cache.Users.CreateOrUpdate<StreamVideoUser, UserResponseInternalDTO>(dto, out _);
public static StreamVideoUser TryCreateOrUpdate(this ICache cache, OwnUserResponseInternalDTO dto)
=> dto == null ? null : cache.Users.CreateOrUpdate<StreamVideoUser, OwnUserResponseInternalDTO>(dto, out _);
public static StreamVideoCallParticipant TryCreateOrUpdate(this ICache cache, Participant dto)
=> dto == null ? null : cache.CallParticipants.CreateOrUpdate<StreamVideoCallParticipant, Participant>(dto, out _);
public static StreamVideoCallParticipant TryCreateOrUpdate(this ICache cache, CallParticipantResponseInternalDTO dto)
=> dto == null ? null : cache.CallParticipants.CreateOrUpdate<StreamVideoCallParticipant, CallParticipantResponseInternalDTO>(dto, out _);
}
}