public Associate AddAssociate(Associate oAssociate)
 {
     using (var context = new SkillTrackerContext())
     {
         oAssociate = context.Associates.Add(oAssociate);
         context.SaveChanges();
         return(oAssociate);
     }
 }
예제 #2
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);
     }
 }
예제 #5
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);
     }
 }
예제 #6
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);
     }
 }