// GET: Tasks public ActionResult Index() { using (ZavenDotNetInterviewContext _ctx = new ZavenDotNetInterviewContext()) { JobsRepository jobsRepository = new JobsRepository(_ctx); List <Job> jobs = jobsRepository.GetAllJobs(); return(View(jobs)); } }
public ActionResult Create(string name, DateTime doAfter) { try { using (ZavenDotNetInterviewContext _ctx = new ZavenDotNetInterviewContext()) { Job newJob = new Job() { Id = Guid.NewGuid(), DoAfter = doAfter, Name = name, Status = JobStatus.New }; newJob = _ctx.Jobs.Add(newJob); _ctx.SaveChanges(); } return(RedirectToAction("Index")); } catch { return(View()); } }
public JobValidator(ZavenDotNetInterviewContext dbContext) { _dbContext = dbContext; }
public JobsRepository(ZavenDotNetInterviewContext ctx) { _ctx = ctx; }
public JobProcessorService(ZavenDotNetInterviewContext ctx) { _ctx = ctx; }
public JobService(ZavenDotNetInterviewContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public JobProcessorService(ZavenDotNetInterviewContext dbContext) { _dbContext = dbContext; }