public async Task <IActionResult> UpdateInterviewPannel([FromBody] InterviewPannel interviewpannel) { try { db.Entry(interviewpannel).State = Microsoft.EntityFrameworkCore.EntityState.Modified; db.SaveChanges(); return(Ok(interviewpannel)); } catch (Exception ex) { var x = ex.Message; return(BadRequest()); } }
public async Task <IActionResult> CreateInterviewPannel([FromBody] InterviewPannel interviewpannel) { try { db.InterviewPannel.Add(interviewpannel); db.SaveChanges(); var k = interviewpannel.PannelId; return(Ok("Interview Pannel created successfully")); } catch (Exception ex) { var x = ex.Message; return(BadRequest()); } }
public async Task <IActionResult> DeleteInterviewPannel([FromBody] InterviewPannel interviewpannel) { try { var result = (from a in db.InterviewPannel where a.InterviewId == interviewpannel.InterviewId select new InterviewPannel { InterviewId = a.InterviewId, PannelId = a.PannelId, InterviewerName = a.InterviewerName }).ToList(); db.InterviewPannel.RemoveRange(result); db.SaveChanges(); return(Ok("Interview Pannel Deleted successfully")); } catch (Exception ex) { var x = ex.Message; return(BadRequest()); } }