public ActionResult <IEnumerable <Department> > Get() { using (var db = new DesafioDbContext()) { return(db.Departments); } }
public ActionResult <Employee> Get(int id) { using (var db = new DesafioDbContext()) { return(db.Employees.First(e => e.id == id)); } }
public ActionResult <IEnumerable <Employee> > Get() { using (var db = new DesafioDbContext()) { return(db.Employees); } }
public ActionResult <Job> Get(int id) { using (var db = new DesafioDbContext()) { return(db.Jobs.First(j => j.id == id)); } }
public ActionResult <IEnumerable <Job> > Get() { using (var db = new DesafioDbContext()) { return(db.Jobs); } }
public ActionResult <Department> Get(int id) { using (var db = new DesafioDbContext()) { return(db.Departments.First(d => d.id == id)); } }
public RequestResponse InsertDb() { var response = new RequestResponse(); try { using (var db = new DesafioDbContext()) { this.dataInclusao = DateTime.Now; if (db.CheckIfPessoaValid(this)) { db.Pessoa.Add(this); db.SaveChanges(); response.message = "Pessoa cadastrado com successo"; response.message += " com Id: "; response.message += this.pessoaId; response.dateInsertion = this.dataInclusao.ToLongDateString(); } else { response.message = "Houve um erro de cadastro" + Environment.NewLine; response.message += "Esse item ja existe."; } } } catch (Exception ex) { response.message = "Houve um erro de cadastro" + Environment.NewLine; response.message += ex.Message; } return(response); }
public void Post([FromBody] Employee e) { using (var db = new DesafioDbContext()) { db.Employees.Add(e); } }
public List <CandidatureResult> Ranking(int idVaga) { var ranking = new List <CandidatureResult>(); using (var db = new DesafioDbContext()) { List <Candidatura> listCand = db.Candidatura.Where(c => c.id_vaga == idVaga).ToList(); var vag = db.Vaga.FirstOrDefault(p => p.vagaId == idVaga); foreach (var can in listCand) { var pers = db.Pessoa.FirstOrDefault(p => p.pessoaId == can.id_pessoa); var resultCand = new CandidatureResult(pers, vag); ranking.Add(resultCand); } } return(ranking.OrderByDescending(c => c.score).ToList()); }
public FamiliaRepository(DesafioDbContext context) { _context = context; }
public UserRepository(DesafioDbContext dbContext) { _dbContext = dbContext; }
protected Repository(DesafioDbContext db) { Db = db; DbSet = db.Set <TEntity>(); }
public StatusService(DesafioDbContext context) { _context = context; }
public TurmaRepository(DesafioDbContext context) : base(context) { }
public PhoneRepository(DesafioDbContext ctx) { _contextDb = ctx; }
public AlunoRepository(DesafioDbContext context) : base(context) { }
public PessoasRepository(DesafioDbContext context) { _context = context; }
public UsuarioRepository(DesafioDbContext context) : base(context) { }
public EscolaRepository(DesafioDbContext context) : base(context) { }
public TransacoesRepository(DesafioDbContext context) { _context = context; }
public PedidoService(DesafioDbContext context) { _context = context; }
public UsuarioRepository(DesafioDbContext ctx) { _contextDb = ctx; }