public static bool isCombustivelInVeiculo(Combustivel combustivel, VeiculoMotorista veiculo)
        {
            foreach (ModeloVeiculoCombustivel combustivelInModeloVeiculo in
                     veiculo.ModeloVeiculoCombustivel)
            {
                if (combustivelInModeloVeiculo.Combustivel == combustivel)
                    return true;
            }

            return false;
        }
 public static bool isCombustivelAlready(VeiculoMotorista veiculo, Combustivel combustivel)
 {
     foreach (ModeloVeiculoCombustivel combustivelInVeiculo in
              bdContext<AbastecimentoEntities>.Instance.BD.ModeloVeiculoCombustivel.
                                               Where(x => x.VeiculoMotorista.Id_VeiculoMotorista == veiculo.Id_VeiculoMotorista))
     {
         if (combustivelInVeiculo.Combustivel == combustivel)
             return true;
     }
     return false;
 }
 /// <summary>
 /// Create a new Combustivel object.
 /// </summary>
 /// <param name="id_Combustivel">Initial value of the Id_Combustivel property.</param>
 public static Combustivel CreateCombustivel(global::System.Int32 id_Combustivel)
 {
     Combustivel combustivel = new Combustivel();
     combustivel.Id_Combustivel = id_Combustivel;
     return combustivel;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Combustivel EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCombustivel(Combustivel combustivel)
 {
     base.AddObject("Combustivel", combustivel);
 }
 public static bool isAnyModeloVeiculo(ref Combustivel combustivel)
 {
     return combustivel.ModeloVeiculoCombustivel.Any();
 }