title: Override base class methods in derived class and fire its event
body: <p>I want to Override base class methods in derived class and then do something in derived class. therefore the base class method be invoked with its generic type . Then I aim to fire the derived class method which is overridden.</p>
  
  <p>I have below codes :</p>
  
  <pre><code>    public class Service&lt;T&gt; : Interface.IService&lt;T&gt; where T : class
      {
  
      public virtual event System.EventHandler&lt;EntitySavingEventArgs&lt;T&gt;&gt; BeforeSavingRecord;
  
      public Service()
      {
  
      }
  
      public virtual void OnBeforeSavingRecord(object sender, EntitySavingEventArgs&lt;T&gt; e)
      {
  
      }
  
      private readonly DbContext _dbContext;
      public Service(DbContext dbContext)
      {
          _dbContext = dbContext;
      }
  
      public virtual void Create(T item)
      {
          if (item == null)
              throw new ArgumentNullException("item");
  
          BeforeSavingRecord?.Invoke(this, new EntitySavingEventArgs&lt;T&gt;() { SavedEntity = item });
          _dbContext.Set(typeof(T)).Add(item);
          _dbContext.SaveChanges();
      }
  }
  </code></pre>
  
  <p>and in its derrived classes I have something like this : </p>
  
  <pre><code>[Service]
  public partial class BankBusiness : Service&lt;Bank&gt;, IBankBusiness
  {
      public BankBusiness()
          : base(ContainerManager.Container.Resolve&lt;MyContext&gt;())
      {
  
      }
  
  
      public override void OnBeforeSavingRecord(object sender, EntitySavingEventArgs&lt;Bank&gt; e)
      {
          //Do something with entity item before saving
          base.OnBeforeSavingRecord(sender, e);
      }
  }
  </code></pre>
  
  <p>And then in my controllers when I call </p>
  
  <pre><code>bankBiz.Create(new Bank() { ... });
  </code></pre>
  
  <p>I want to fire bankBiz (derrived class) overridden method (OnBeforeSavingRecord) which is registered to BeforeSavingRecord event.</p>
  
  <p>I donot know if my scenario is correct and if it is right how i can fire it. </p>
  
  <p>if it is not correct what I should do.</p>