public Associate AddAssociate(Associate oAssociate) { using (var context = new SkillTrackerContext()) { oAssociate = context.Associates.Add(oAssociate); context.SaveChanges(); return(oAssociate); } }
public Skill AddSkill(Skill oSkill) { using (var context = new SkillTrackerContext()) { oSkill = context.Skills.Add(oSkill); context.SaveChanges(); return(oSkill); } }
public bool DeleteAssosciate(Associate objAssosciate) { using (var context = new SkillTrackerContext()) { objAssosciate = context.Associates.FirstOrDefault(x => x.Associate_ID == objAssosciate.Associate_ID); context.Associates.Remove(objAssosciate); context.SaveChanges(); return(true); } }
public Associate UpdateAssociate(Associate oAssociate) { using (var context = new SkillTrackerContext()) { oAssociate = context.Associates.Attach(oAssociate); context.Entry(oAssociate).State = EntityState.Modified; context.SaveChanges(); return(oAssociate); } }
public bool DeleteSkill(Skill oSkill) { using (var context = new SkillTrackerContext()) { oSkill = context.Skills.FirstOrDefault(x => x.Skill_ID == oSkill.Skill_ID); context.Skills.Remove(oSkill); context.SaveChanges(); return(true); } }
public Skill UpdateSkill(Skill oSkill) { using (var context = new SkillTrackerContext()) { oSkill = context.Skills.Attach(oSkill); context.Entry(oSkill).State = EntityState.Modified; context.SaveChanges(); return(oSkill); } }