// PUT api/values/5
 public HttpResponseMessage Put(int id, tblSchoolYear schoolYearDetails)
 {
     try
     {
         var schoolYear = unitOfWork.SchoolyearRepository.GetByID(id);
         schoolYear.SchoolYear = schoolYearDetails.SchoolYear;
         schoolYear.Status     = schoolYearDetails.Status;
         schoolYear.SchoolID   = schoolYearDetails.SchoolID;
         unitOfWork.SchoolyearRepository.Update(schoolYear);
         unitOfWork.Save();
         return(Request.CreateResponse <tblSchoolYear>(HttpStatusCode.OK, schoolYear));
     }
     catch
     {
         return(Request.CreateResponse <tblSchoolYear>(HttpStatusCode.NotFound, null));
     }
 }
        public void DeleteSchoolYear(int tblSchoolYearid)
        {
            tblSchoolYear schoolyear = context.tblSchoolYear.Find(tblSchoolYearid);

            context.tblSchoolYear.Remove(schoolyear);
        }
 public void UpdateSchoolYear(tblSchoolYear schoolyear)
 {
     context.Entry(schoolyear).State = System.Data.Entity.EntityState.Modified;
 }
 public void InsertSchoolYear(tblSchoolYear schoolyearId)
 {
     context.tblSchoolYear.Add(schoolyearId);
 }