public string ConverMessageJsonForITSupporterOfflineFirebaseViewModel(ITSupporterOfflineFirebaseViewModel data, Notification noti) { Dictionary <string, object> androidMessageDic = new Dictionary <string, object>(); androidMessageDic.Add("to", $"/topics/{data.ITSupporterId}"); androidMessageDic.Add("data", data); androidMessageDic.Add("notification", noti); return(JsonConvert.SerializeObject(androidMessageDic)); }
public ITSupporterOfflineFirebaseViewModel RenderDataForITSupporterOffline(int itSupporterId) { var itSupporterRepo = DependencyUtils.Resolve <IITSupporterRepository>(); var itSupporter = itSupporterRepo.GetActive().SingleOrDefault(p => p.ITSupporterId == itSupporterId); var itSupporterOfflineFirebaseViewModel = new ITSupporterOfflineFirebaseViewModel() { ITSupporterName = itSupporter.ITSupporterName, ITSupporterId = itSupporter.ITSupporterId, isOnline = itSupporter.IsOnline ?? false, AccountId = itSupporter.AccountId, Username = itSupporter.Account.Username }; return(itSupporterOfflineFirebaseViewModel); }