public void InsertDoctor(Doctor doctor) { //doctor object has clinics selected _unitOfWork.DoctorRepository.Insert(doctor); _unitOfWork.Save(); }
public virtual void Insert(TEntity entity) { _dbSet.Add(entity); }
namespace DoctorBooking.DomainEntities { public class Doctor { [Key] public Int32 DoctorId { get; set; } public string LastName { get; set; } public string FirstName { get; set; } public virtual ICollection Clinics { get; set; } } }
namespace DoctorBooking.DomainEntities { public class Clinic { [Key] public Int32 ClinicId { get; set; } public string Name { get; set; } public int ContactNumber { get; set; } public string Email { get; set; } public virtual ICollection Doctors { get; set; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)