public async Task SendAKudo(string connectionid, int kudocount, KudoViewModel kudovm) { var user = await _userManager.FindByNameAsync(kudovm.username); var thelistoid = _listrepo.GetListoidById(kudovm.ListoidId); await _listrepo.GiveListoidAKudo(new Kudo { User = user, listoid = thelistoid, }).ContinueWith(delegate { if (kudocount > 1) { var x = _listrepo.GetActiveList(); var listoidViewModel = new ListoidViewModel() { MasterListId = x.MasterListId, Kudos = 3, MessageBody = thelistoid.MessageBody, Username = thelistoid.User.UserName, CreateDate = thelistoid.CreateDate }; Clients.All.SendAsync("NewMasterListItem", listoidViewModel); } }); await Clients.Client(connectionid).SendAsync("ReceiveCurrentPurgatoryItems", _listrepo.GetAllPurgatoryItemsForClient()); await Clients.Client(connectionid).SendAsync("ReceiveCurrentMasterList", _listrepo.GetMasterListName(), _listrepo.GetAllCurrentMasterListForClient()); }
public KudoViewModel MapKudoModelToViewModel(Kudo kudo) { var kudoViewModel = new KudoViewModel(); kudoViewModel.Id = kudo.Id; kudoViewModel.CategoryId = kudo.Category.Id; kudoViewModel.Content = kudo.Content; kudoViewModel.Sender = kudo.Sender; kudoViewModel.ReceiverId = kudo.Receiver.Id; kudoViewModel.DateUpdated = kudo.DateUpdated; return(kudoViewModel); }