Doctor Build(Doctor doctor)
 {
     return new Doctor()
     {
         Name = doctor.Name,
         Address = doctor.Address,
         Description = doctor.Description,
         Phone = doctor.Phone,
         Mobile = doctor.Mobile,
         Email = doctor.Email,
         Picture = doctor.Picture,
         DoctorId = doctor.DoctorId,
         Deleted = doctor.Deleted,
         Speciality = doctor.Speciality,
         TenantId = doctor.TenantId,
         PatientCount = doctor.PatientCount,
         CurrentRoomNumber = doctor.CurrentRoomNumber,
         CreatedAt = doctor.CreatedAt
     };
 }
 public async Task<int> AddAsync(Doctor doctor)
 {
     doctor.Id = Guid.NewGuid().ToString();
     _context.Doctors.Add(doctor);
     await _context.SaveChangesAsync();
     return doctor.DoctorId;
 }
 public async Task UpdateAsync(Doctor doctor)
 {
     _context.Doctors.Update(doctor);
     await _context.SaveChangesAsync();
 }
        static void CreateDoctors(MyHealthContext context, int tenantId)
        {
            var doctors = new List<Doctor>();

            var doctor = new Doctor
            {
                Name = "Amanda Silver",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetPatientPicture(4),
                TenantId = tenantId,
                Speciality = Specialities.Cardiologist,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = "D0ACA653-2AB1-4160-87FC-21E72FD2ED44",
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 4, 12)
            };
            doctors.Add(doctor);

            doctor = new Doctor
            {
                Name = "Casey Snider",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetDoctorPicture(1),
                TenantId = tenantId,
                Speciality = Specialities.Cardiologist,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = Guid.NewGuid().ToString(),
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 4, 10)
            };
            doctors.Add(doctor);

            doctor = new Doctor
            {
                Name = "Clay McKnight",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetDoctorPicture(2),
                TenantId = tenantId,
                Speciality = Specialities.Neurosurgeon,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = Guid.NewGuid().ToString(),
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 5, 19)
            };
            doctors.Add(doctor);

            doctor = new Doctor
            {
                Name = "Jasper Strader",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetDoctorPicture(3),
                TenantId = tenantId,
                Speciality = Specialities.Ophthalmologist,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = Guid.NewGuid().ToString(),
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 3, 22)
            };
            doctors.Add(doctor);

            doctor = new Doctor
            {
                Name = "Eldon Caraway",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetDoctorPicture(4),
                TenantId = tenantId,
                Speciality = Specialities.Orthopedist,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = Guid.NewGuid().ToString(),
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 6, 11)
            };
            doctors.Add(doctor);

            doctor = new Doctor
            {
                Name = "Irving Ingraham",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetDoctorPicture(5),
                TenantId = tenantId,
                Speciality = Specialities.Orthopedist,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = Guid.NewGuid().ToString(),
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 5, 30)
            };
            doctors.Add(doctor);

            doctor = new Doctor
            {
                Name = "Denis Slattery",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetDoctorPicture(6),
                TenantId = tenantId,
                Speciality = Specialities.Ophthalmologist,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = Guid.NewGuid().ToString(),
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 3, 16)
            };
            doctors.Add(doctor);

            doctor = new Doctor
            {
                Name = "Peter Ingraham",
                Address = "Madison Ave 10037, New York, NY 10037",
                Email = "*****@*****.**",
                Deleted = false,
                Picture = GetDoctorPicture(7),
                TenantId = tenantId,
                Speciality = Specialities.Neurosurgeon,
                Synchronized = true,
                PatientCount = Randomize.Next(50, 100),
                CurrentRoomNumber = Randomize.Next(3, 15),
                Id = Guid.NewGuid().ToString(),
                Description = "Monitoring and providing general care to patients on hospital wards and in outpatient clinics.",
                Phone = "555-135-2245",
                Mobile = "1-(546)-345-5678",
                CreatedAt = new DateTime(2015, 7, 26)
            };
            doctors.Add(doctor);

            context.Doctors.AddRange(doctors);
            context.SaveChanges();
        }