public ActionResult Index() { var model = new TopUserViewModel(); model.GetTopUsers(); return(View(model)); }
public async Task AddUserInTop(TopUserViewModel user) { user.ConectionId = Context.ConnectionId; await userService.AddInTop(user); Clients.Caller.UserAdded(); }
/// <summary> /// Добавиление победителя в ТОП /// </summary> /// <param name="conectionId">id сесии соединения</param> /// <param name="userName">Имя пользователя</param> /// <param name="movesCount">Количество ходов пользователя</param> /// <param name="gameTime">Игровое время</param> private TopUserViewModel GetWinUser(string conectionId, string userName, int movesCount, TimeSpan gameTime) { var userViewModel = new TopUserViewModel { UserName = userName, Count = movesCount, Time = gameTime, ConectionId = conectionId }; return(userViewModel); }
public async Task AddInTop(TopUserViewModel viewModel) { var user = new TopUser { ConectionId = viewModel.ConectionId, CountMoves = viewModel.Count, Time = viewModel.Time, UserName = viewModel.UserName }; db.TopUsers.Add(user); await db.SaveChangesAsync(); }
public TopUserPage() { InitializeComponent(); BindingContext = new TopUserViewModel(); }
public CellResponse(MoveStatuses status, Cell сell, TopUserViewModel results) { Cell = сell; this.status = status; Results = results; }