// Get rider detail by id public RiderDetails GetRiderDetail_ById(int id) { try { RiderDetails rider = db.RiderDetails.Find(id); return(rider); } catch { throw; } }
// Update rifer public int EditRider(RiderDetails rider) { try { db.RiderDetails.Update(rider); db.SaveChanges(); return(1); } catch { throw; } }
// Add rider public int AddRider(RiderDetails rider) { try { db.RiderDetails.Add(rider); db.SaveChanges(); return(1); } catch { throw; } }
// Delete rider public int DeleteRider(int id) { try { RiderDetails rider = new RiderDetails(); rider = db.RiderDetails.Find(id); db.RiderDetails.Remove(rider); db.SaveChanges(); return(1); } catch { throw; } }