public async Task <int> AddPatient(Patient patient) { if (dbcontext != null) { await dbcontext.AddAsync(patient); await dbcontext.SaveChangesAsync(); return(patient.Id); } return(0); }