I've got a class like:

public class Food
{
  public static IList<Ingredient> ingredients
  public bool uses(Ingredient i)
  {
    return ingredients.Contains(i);
  }
}

I Quickly inherit from this to create several types of food like:

public class Cake : public Food
{
  public static IList<Ingredient> ingredients = new List<Ingredient>()
  {
    Sugar,
    Eggs,
    Milk
  }
}

Now I wish to have the ability to do

Food f = getFood();
if (f.uses(Eggs))
{
   // Do something
}

So I wish to possess a static listing of elements that (for instance) all cakes can share, instead of a listing per demonstration of Cake and have the ability to can get on inside a virtual way.

I am prepared to stir the code around to obtain a similar effect as needed!

In such instances, the OOD "prefer" to create the course Food abstract, because the "Elements" will change from the Food to a different. Thus, as others have stated, causeing this to be list static is meaningless, since static ought to be a modifier for an attribute which isn't distinguishing through the objects.

I would recommend an answer the following:

public abstract class Food
{
   public abstract IList<Ingredient> Ingredients
   {
       get;
   }
}

Now any class - to become a concrete - is going to be driven from Food and for that reason it has to implement this property to ensure that it gives its very own ingredients:

public class Cake : Food
{
  public override IList<Ingredient> Ingredients
  {
      get { 
              return new IList<Ingredient>()
              { Sugar, Eggs, Milk };
          }
  }
}

You can define a technique GetIngredients() the subclasses override:

public abstract class Food
{
  public static IList<Ingredient> ingredients
  public bool uses(Ingredient i)
  {
    return GetIngredients().Contains(i);
  }

  protected abstract IList<Ingredient> GetIngredients();
}


public class Cake : public Food
{
  public static IList<Ingredient> ingredients = new List<Ingredient>()
  {
    Sugar,
    Eggs,
    Milk
  }

   protected override IList<Ingredient> GetIngredients()
   {
      return ingredients ;
   }
}

How about making all this cases of one class? like:

class Food
{
    public IList<Ingredient> ingredients;
    public Food(IList<Ingredient> ingredients)
    {
        this.ingredients = ingredients.Clone();
    }
    public bool uses(Ingredient i)
    {
        return ingredients.Contains(i);
    }
}

Food Cake = new Food({ Sugar, Eggs, Milk });

The elements don't need to be static. You could have all kinds of different cakes be a consequence of the wedding cake class to ensure that they inherit the most popular elements:

public class Cake : Food 
{ 
  public IList<Ingredient> ingredients = new List<Ingredient>() 
  { 
    Sugar, 
    Eggs, 
    Milk 
  } 
} 


public class DevilsFoodCake : Cake 
{ 
  public DevilsFoodCake()
  {
        ingredients.AddRange(new List<Ingredient>() 
        { 
            Chocolate,
            SourCream
        } 
   }
}