Пример #1
0
 public static OnUpdatingArgs ToUpdatingArgs(this UpdatedEventInfo info, ISession session, Type type = null)
 {
     type = type ?? info.GetType().GenericTypeArguments[0];
     return
         (Activator.CreateInstance(typeof(OnUpdatingArgs <>).MakeGenericType(type), info, session) as
          OnUpdatingArgs);
 }
Пример #2
0
 public static UpdatedEventInfo GetTypedInfo(this UpdatedEventInfo info, Type type)
 {
     if (info == null)
     {
         return(null);
     }
     return(Activator.CreateInstance(typeof(UpdatedEventInfo <>).MakeGenericType(type), info) as UpdatedEventInfo);
 }