public void SaveSkill(SkillsEvaluation skillEvaluation) { try { using (var db = new DatabaseContainer()) { db.SkillsEvaluations.Where(x => x.Id == skillEvaluation.Id).First().Mark = skillEvaluation.Mark; db.SaveChanges(); } } catch (Exception e) { } }
public long AddSkill(Candidate candidate, SkillsEvaluation skillEvaluation, string skillName) { try { using (var db = new DatabaseContainer()) { skillEvaluation.Skill = db.Skills.Where(x => x.Name == skillName).First(); skillEvaluation.Mark = skillEvaluation.Mark; skillEvaluation.EvaluationId = candidate.Evaluation.Id; db.Entry(skillEvaluation).State = System.Data.Entity.EntityState.Added; db.Entry(skillEvaluation.Skill).State = System.Data.Entity.EntityState.Unchanged; db.SaveChanges(); } } catch (Exception e) { } return(skillEvaluation.Id); }