I have the following class
public class AccountingBase<TItemType> where TItemType : AccountingItemBase
And in my AccountingItemBase i have the following property:
public virtual AccountingBase<AccountingItemBase> Parent { get; set; }
in my AccountingBase, I am trying to do the following
item.Parent = this;
Logically this should work, as TItemType inherits from AccountingItemBase, but instead i get the following error:
> Error 1 Cannot implicitly convert type
> 'TGS.MySQL.DataBaseObjects.AccountingBase<TItemType>'
> to
> 'TGS.MySQL.DataBaseObjects.AccountingBase<TGS.MySQL.DataBaseObjects.AccountingItemBase>'
How can i set the child properties parent property to itself (inside the parent class)