public static void AddVisitorParking(SpaceParkContext context, ParkingLot parkingSpace, Visitor visitor) { var visitorParking = new VisitorParking { VisitorID = visitor.VisitorID, ParkingLotID = parkingSpace.ParkingLotID, DateOfEntry = DateTime.Now }; context.VisitorParking.Add(visitorParking); context.SaveChanges(); }
public static VisitorParking GetSpecificVisitorParking(SpaceParkContext context, Visitor visitor) { return(context.VisitorParking .Where(parking => parking.VisitorID == visitor.VisitorID) .FirstOrDefault()); }