public static MyClass <T> Create <T, T2>(MyClass <T2> parent = null) { var current = new MyClass <T>(); current.Id = Atomic.Increment(ref _counter); current.ParentId = parent?.Id; return(current); }