Ejemplo n.º 1
0
        public async Task <int> RemoveAppointment(int id)
        {
            Appointment appt = new Appointment()
            {
                Id = (short)id
            };

            _dbc.Appointment.Attach(appt);
            _dbc.Appointment.Remove(appt);
            return(await _dbc.SaveChangesAsync());
        }
Ejemplo n.º 2
0
        public async Task <int> SignUp(User user, string password)
        {
            var helper = new EncryptionHelper();

            byte[] passwordHash, passwordSalt;
            helper.CreatePasswordHash(password, out passwordHash, out passwordSalt);

            user.PasswordHash = passwordHash;
            user.PasswordSalt = passwordSalt;

            _dbc.User.Add(user);
            return(await _dbc.SaveChangesAsync());
        }