class Test { public BinaryWriter Content { get; private set; } public Test Write (T data) { Content.Write(data); return this;
You can't do that.
Since real type of T is unknown at compile-time, compiler can't find appropriate Write overload, and tries to call the first found one. There is no overload, which could be called with any type of T (e.g., Write(object)).
T
Write
Write(object)