public OrderState GetOrderState(int orderID, byte state) { return(OrderStates .Include(col => col.StateNavigation) .Where(x => x.OrderId == orderID) .Where(x => x.State == state).FirstOrDefault()); }
public IEnumerable <OrderState> GetOrderStates(int orderID) { return(OrderStates .Include(col => col.StateNavigation) .Where(x => x.OrderId == orderID) .OrderBy(x => x.State)); //to samo co po date ale szybciej }