S
SyntaxError
I have a base class Entity<TEntity> as shown below:
public abstract class Entity<TEntity> : IMarconeEntity, ICloneable
where TEntity : class, INotifyPropertyChanged,
INotifyPropertyChanging, IMarconeEntity, new()
{
public bool IsNew{get;set;}
}
In another class, I have an IList<object> collection which contains classes
derived from Entity<TEntity>.
foreach (object item in this.GetChangeSet().Updates) //
GetChangeSet().Updates return IList<object>
{
// I need to set the IsNew property for each of these items.
// How can I cast to the generic type without knowing the TEntity
type?
}
Thanks in advance,
Syntax
public abstract class Entity<TEntity> : IMarconeEntity, ICloneable
where TEntity : class, INotifyPropertyChanged,
INotifyPropertyChanging, IMarconeEntity, new()
{
public bool IsNew{get;set;}
}
In another class, I have an IList<object> collection which contains classes
derived from Entity<TEntity>.
foreach (object item in this.GetChangeSet().Updates) //
GetChangeSet().Updates return IList<object>
{
// I need to set the IsNew property for each of these items.
// How can I cast to the generic type without knowing the TEntity
type?
}
Thanks in advance,
Syntax