public IEnumerable <TravelNotification> GetNotificationByStatus(int statusid, int userid) { IEnumerable <TravelNotification> travelnotification = _context.TravelNotifications.Where(x => x.StepNotificationId == statusid && x.UserId == userid && x.Status == true).ToList().OrderByDescending(x => x.NotificationDate); foreach (TravelNotification notification in travelnotification) { notification.Status = false; _context.Entry(notification).State = System.Data.Entity.EntityState.Modified; } _context.SaveChanges(); return(travelnotification); }
public void DeleteTravelDetail(TravelDetail TravelDetailObj) { _context.Entry(TravelDetailObj).State = System.Data.Entity.EntityState.Deleted; _context.SaveChanges(); }