using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ServiceModel; namespace EHEC_Server.DatabaseAccess { public class DoctorAccess { public Doctor CreateDoctor(Doctor doctor) { try { using (EHEC_DBEntities ctx = new EHEC_DBEntities()) { ctx.Doctor.Add(doctor); ctx.SaveChanges(); } return doctor; } catch (Exception) { return new Doctor(); } } public List GetAllDoctors() { using (EHEC_DBEntities ctx = new EHEC_DBEntities()) { return ctx.Doctor.ToList(); } } } }