title: Implementing BaseEntity class in c#
body: <p>I'm trying to implement <code>BaseEntity</code> class in a c# and I've found example like this:</p>
  
  <pre><code> public abstract class BaseEntity&lt;T&gt; : IBaseEntity&lt;T&gt;
   {
      public T Id { get; set; }
      object IBaseEntity.Id
      {
         get { return Id; }
      }
      public bool IsValid { get; set; }
      public DateTime CreatedDate { get; set; }
      public DateTime ModifiedDate { get; set; }
   }
  </code></pre>
  
  <p>I'm wondering why is this example inheriting from Interface <code>IBaseEntity</code>, was this really needed?</p>
  
  <p>What this piece of code acctually does?</p>
  
  <pre><code>object IBaseEntity.Id
  {
      get { return Id; }
  }
  </code></pre>
  
  <p><strong>This stuffs are really confusing me..</strong></p>
  
  <p>Couldn't this be written simply like this:</p>
  
  <pre><code>public abstract class BaseEntity&lt;T&gt; 
  {
      public T Id { get; set; } // I guess this "T" means that this id might be of different type? like long, guid, int?
  
      public bool IsValid { get; set; }
      public DateTime CreatedDate { get; set; }
      public DateTime ModifiedDate { get; set; }
  }
  </code></pre>
  
  <p>I guess it could be written like in this last example, but first example is more benefitial I guess? 
  But I can't recognize why since I'm really beginner.</p>
  
  <p>If someone could explain it to me I would appreaciate that so much!</p>
  
  <p>Thanks in advance!</p>