public Model.Order GetOrder(Model.Order order) { Entity.Order found = _context.Orders.FirstOrDefault(ord => ord.Time == order.Time && ord.Customer == order.Customer.Id && ord.Location == GetLocation(order.Location).Id); if (found == null) { return(null); } //Entity.Order foundManager = _context.Customers.FirstOrDefault(id => id.Id == found.Manager); return(new Model.Order(found.Id, order.Customer, order.Location, found.Total, found.Time)); //new Model.Customer(foundManager.Name, foundManager.Username, foundManager.Password) }
// whhy is this bugging? cannot figure this part out for the life of me // some kind of scaffolding error i believe public Model.Order AddOrder(Model.Order order) { _context.Orders.Add( new Entity.Order { Customer = order.Customer.Id, Location = order.Location.Id, Total = order.Total, Time = order.Time } ); _context.SaveChanges(); return(order); }