sharparchitecture / Sharp-Architecture

S#arp Architecture: ASP.NET MVC Best Practices with NHibernate
http://sharparchitecture.github.io/
Other
591 stars 152 forks source link

Add IEntity non-generic interface #214

Closed cd21h closed 4 years ago

cd21h commented 4 years ago

Add non-generic base interface for IEntityWithTypedId<>

interface IEntity {
    object GetId();
}

This will simplify code for cases similar to below

if (x is IEntity entity) {
  _log.Write("Entity id: {0}", entity.GetId());
}