public List <Associate> GetAllAssociates()
 {
     using (var context = new SkillTrackerContext())
     {
         return(context.Associates.ToList());
     }
 }
Example #2
0
 public Skill GetSkillBySkillDetail(Skill oSkill)
 {
     using (var context = new SkillTrackerContext())
     {
         return(context.Skills.Where(s => s.Skill_Name == oSkill.Skill_Name).FirstOrDefault());
     }
 }
Example #3
0
 public List <Skill> GetAllSkills()
 {
     using (var context = new SkillTrackerContext())
     {
         return(context.Skills.ToList());
     }
 }
 public Associate AddAssociate(Associate oAssociate)
 {
     using (var context = new SkillTrackerContext())
     {
         oAssociate = context.Associates.Add(oAssociate);
         context.SaveChanges();
         return(oAssociate);
     }
 }
Example #5
0
 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);
     }
 }
Example #8
0
 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);
     }
 }
Example #9
0
 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);
     }
 }