public Token Get(string id, string password) { Userdtl obj = _repository.UserLogin(id, password); MentorDtl obj1 = _repository.MentorLogin(id, password); if (obj != null) { return(new Token() { message = "User", token = GetToken(), username = obj.UserName, active = obj.Active, useid = obj.UserId }); } else if (obj1 != null) { return(new Token() { message = "Mentor", token = GetToken(), username = obj1.MentorName, active = obj1.Active, useid = obj1.MentorId }); } else if (id == "Admin" && password == "Admin") { return(new Token() { message = "Admin", token = GetToken(), username = "******" }); } else { return(new Token() { message = "Invalid User", token = "" }); } }
public void Add(MentorDtl item) { try { _context.MentorDtls.Add(item); _context.SaveChanges(); } catch (Exception) { throw; } }
public void Put(string id, [FromBody] MentorDtl item) { _repository.Update(item); }
public IActionResult Post(MentorDtl item) { _repository.Add(item); return(Ok("Record Added")); }
public MentorDtl SelectMentor(long MentorId) { MentorDtl mentor = new MentorDtl(); return(mentor); }
public void Update(MentorDtl item) { _context.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Modified; _context.SaveChanges(); }
public MentorDtl ViewProfile(long MentorId) { MentorDtl mentor = new MentorDtl(); return(mentor); }
public MentorDtl ViewMentor(long Id) { MentorDtl mentordetails = new MentorDtl(); return(mentordetails); }
public void Add(MentorDtl item) { _context.MentorDtls.Add(item); _context.SaveChanges(); }