Beispiel #1
0
        public async Task <bool> SalvaStudente(Studente s)
        {
            bool  result = false;
            Citta citta  = await _db.Citta.FindAsync(s.IdCitta);

            if (citta != null)
            {
                _db.Studenti.Add(s);
                await _db.SaveChangesAsync();

                result = true;
            }
            return(result);
        }
Beispiel #2
0
        public async Task <bool> SalvaCorso(Corso c)
        {
            bool  result = false;
            Citta citta  = await _db.Citta.FindAsync(c.IdCitta);

            PersonaFitstic p = await _db.PersonaleFitstic.FindAsync(c.IdOrganizzatore);

            if (citta != null && p != null)
            {
                _db.Corsi.Add(c);
                await _db.SaveChangesAsync();

                result = true;
            }
            return(result);
        }