public async Task <Response> CreateResponseAsync() { UserFavoritesDto favorites = await favoritesService.AddUserFavoritesAsync( request.ChannelId, request.ChatId, request.ContactId, clientConnection.UserId.Value).ConfigureAwait(false); return(new FavoritesResponse(request.RequestId, new List <UserFavoritesVm> { UserFavoritesConverter.GetUserFavoriteVm(favorites, clientConnection.UserId.GetValueOrDefault()) })); }
public static UserFavorite GetUserFavorite(UserFavoritesDto userFavorite) { if (userFavorite == null) { return(null); } return(new UserFavorite { ChannelId = userFavorite.ChannelId, ChatId = userFavorite.ChatId, ContactId = userFavorite.ContactId, UserId = userFavorite.UserId }); }
public static UserFavoritesVm GetUserFavoriteVm(UserFavoritesDto userFavorites, long userId) { if (userFavorites == null) { return(null); } return(new UserFavoritesVm { Channel = ChannelConverter.GetChannelVm(userFavorites.Channel, userId), ChannelId = userFavorites.ChannelId, Chat = ChatConverter.GetChatVm(userFavorites.Chat), ChatId = userFavorites.ChatId, Contact = ContactConverter.GetContactVm(userFavorites.Contact), ContactId = userFavorites.ContactId, SerialNumber = userFavorites.SerialNumber }); }