BistroDriveWebApp.Models.OrderRepository.GetOrderById C# (CSharp) Method

GetOrderById() public method

public GetOrderById ( int id ) : order
id int
return order
        public order GetOrderById(int id)
        {
            var order = context.orders.FirstOrDefault(o => o.Id_Order == id);
            if(order == null)
            {
                return null;
            }
            order.ordercontactmethod = DataManager.Contact.GetContactById(order.Id_ContactMethod);
            order.orderdelivery = DataManager.Delivery.GetDeliveryById(order.Id_Delivery);
            order.orderingridientbuyer = DataManager.IngridientsBuyer.GetIngridientBuyerById(order.id_IngridientsBuyer);
            order.orderpaymentmethod = DataManager.PaymentMethod.GetPaymentMethodById(order.Id_PaymentMethod);
            order.orderstatu = DataManager.Status.GetOrderStatusById(order.Id_Status);
            order.aspnetuser = DataManager.User.GetUserById(order.Id_Cook);
            order.city = DataManager.Geolocation.GetCityById(order.id_city);
            return order;
        }