public static class IMvSyncEntityExtensions { public static T CheckEntityTypeAndClearFields<T>(this T item) where T : IMvSyncEntity { if (item.SavedEntityType == MultiversSyncEntityType.Unknown) { item.SavedEntityType = item.SyncEntityType; return item; } if (item.SavedEntityType != MultiversSyncEntityType.Creditor) { item.MVId = null; item.MVError = null; item.MVLastSynced = null; } return item; } }
640700cookie-checkC# Generic extension method on interface