public static IVacancyRepository Create(SkilledContext context, ILoggedInEmployee loggedInEmployee) { if (loggedInEmployee != null) { return(new EmployeeVacancyRepository(context, loggedInEmployee.EmployerId)); } return(new NotAuthorizedRepository()); }
public CmsUnitOfWork(SkilledContext context, ILoggedInEmployee loggedInEmployee) { _context = context; context.Database.Log = (s) => Debug.Write(s); //Vacancies = new BaseRepository<Vacancy>(context); Vacancies = VacancyRepositoryFactory.Create(context, loggedInEmployee); Skills = new BaseRepository <Skill>(context); ThinkLevels = new BaseRepository <ThinkLevel>(context); Zipcodes = new BaseRepository <Zipcode>(context); ZipcodeDistances = new BaseRepository <ZipcodeDistance>(context); MailingRecipientsComingSoon = new BaseRepository <MailingRecipientComingSoon>(context); ContactPersons = new BaseRepository <ContactPerson>(context); Employees = new BaseRepository <Employee>(context); EmployeeGroups = new BaseRepository <EmployeeGroup>(context); Permissions = new BaseRepository <Permission>(context); }