public IEnumerable <CandidateDTO> GetAllCandidates()
 {
     using (CandidatesDBContext context = new CandidatesDBContext())
     {
         IEnumerable <Candidate> candidates = context.Candidates;
         return(MapperConfig.MapperDAL.Map <IEnumerable <CandidateDTO> >(candidates));
     }
 }
示例#2
0
 public void CanAccessDatabase()
 {
     using (var ctx = new CandidatesDBContext())
     {
         Skill skill = new Skill("test");
         ctx.Skills.Add(skill);
         ctx.SaveChanges();
         ctx.Skills.Remove(skill);
         ctx.SaveChanges();
     }
 }
 public CandidateController(CandidatesDBContext context)
 {
     _context = context;
 }
 public SQLPersistenceManager()
 {
     intranetCtx        = new IntranetDBContext();
     candidateDBContext = new CandidatesDBContext();
 }
示例#5
0
 public CandidateDAO(CandidatesDBContext ctx)
 {
     this.ctx = ctx;
 }