Q:

create a string list from a generic class and and apply TrueForAll on that list

Here i have a generic class called "GoodBuffer".I've created a list of string from that class.The class has a generic list as property on which i can operate different method.I want to implement TrueForAll method on that list to find if any string member of that list ends with "ball".So i created a CheckEndsWithBall method and implemented TrueForAll on the internal list.But i am getting the following error : 

'T' does not contain a definition for 'Endswith' and no extension
  method 'Endswith' accepting a first argument of type 'T' could be
  found (are you missing a using directive or an assembly reference?)

GoodBuffer class : 
class GoodBuffer<T>
{
    List<T> bufferList;
    public GoodBuffer()
    {
        bufferList = new List<T>();
    }

    public void Add(T val)
    {
        bufferList.Add(val);
    }

    public int Size()
    {
        return bufferList.Count();
    }
    public bool CheckEndsWithBall()
    {          
        return bufferList.TrueForAll(b => b.EndsWith("ball"));
    }

}

main functin :
static void Main(string[] args)
{
    var s = new GoodBuffer<string>();

    s.Add("redball");
    s.Add("blue");

    Console.WriteLine(s.Size());

    Console.WriteLine(s.CheckEndsWithBall());

    Console.ReadLine();
}

A:

You need explicitly convert your T to string. Try this code:
public bool CheckEndsWithBall()
{          
    return bufferList.TrueForAll(b => b.ToString().EndsWith("ball"));
}

UPD: When compiler see GoodBuffer class it does know nothing about T. And you telling to compiler: "execute method on T". How can compiler be sure that this method exists? Generics in c# are not same as templates in C++. Generic class will be compiled into "open type" without looking at further usage.
However, you can use type constraint like this:
public interface ICanCheckEndsWith
{
    bool EndsWith(string end);
}

public class StringWrapper : ICanCheckEndsWith
{
    public string String { get; set; }

    public bool EndsWith(string end)
    {
        return String.EndsWith(end);
    }
}

public class GoodBuffer<T> where T : ICanCheckEndsWith
{
    private List<T> buffer = new List<T>();

    public bool CheckEndsWithBall()
    {
        return buffer.TrueForAll(b => b.EndsWith("ball"));
    }
}

