public int DeleteSkills([FromBody] UserSkill skill) { FRDBEntities db = new FRDBEntities(); using (db) { return(db.DeleteUserSkills(skill.user, skill.id)); } }
public int DeleteSkills([FromBody] DeleteModels skill) { FRDBEntities db = new FRDBEntities(); int SkillId, UserId; using (FRDBEntities db1 = new FRDBEntities()) { SkillId = db1.GetSkillByName(skill.value).FirstOrDefault <GetSkillByName_Result>().id; } using (FRDBEntities db2 = new FRDBEntities()) { UserId = db2.GetUserId(skill.email).FirstOrDefault() ?? 0; } using (db) { return(db.DeleteUserSkills(UserId, SkillId)); } }