Exemple #1
0
        public async void UpdatePerson(Person updPerson)
        {
            try
            {
                _context.People.FirstOrDefault(p => p.Id == updPerson.Id).IsHere = updPerson.IsHere;
                await _context.SaveChangesAsync();
            }
            catch { }

            Clients.Others.checkinOthers(updPerson);
        }
Exemple #2
0
        public async void AddPerson(string firstName, string lastName)
        {
            Person person = new Person
            {
                FirstName = firstName,
                LastName = lastName,
                IsHere = false
            };

            // todo add to bd
            _context.People.Add(person);
            await _context.SaveChangesAsync();

            // todo triger update on conneted clients
            Clients.All.addPerson(person);

        }