コード例 #1
0
        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();
        }
コード例 #2
0
 public static VisitorParking GetSpecificVisitorParking(SpaceParkContext context, Visitor visitor)
 {
     return(context.VisitorParking
            .Where(parking => parking.VisitorID == visitor.VisitorID)
            .FirstOrDefault());
 }