Your extension is acting on the type Owngeneric<t> so that's what needs to be your "this"
public static int extnlenght<T>(this Owngeneric<T> entity)
{
return entity.Count;
}
Next your custom class needs a way of returning the count of the items it holds, so you need to implement that too;
public class Owngeneric<T>
{
int i = 0;
public T[] _data = new T[1];
public void addvalue(T value)
{
_data[i] = value;
i++;
Array.Resize(ref _data, _data.Length + 1);
}
public int Count
{
get
{
return _data.Length;
}
}
}