public static void LoadEntitySet(ILoadEntitySet <TEntity> msg) { try { using (var ctx = new TDBContext()) { var loggerFactory = ctx.GetService <ILoggerFactory>(); loggerFactory.AddProvider(new MyLoggerProvider()); IQueryable <TDBEntity> rres = ctx.Set <TDBEntity>().AsNoTracking(); var res = rres.OrderByDescending(x => x.Id).Select(x => (TEntity)(object)x).ToList(); //; EventMessageBus.Current.Publish(new EntitySetLoaded <TEntity>(res, new StateEventInfo(msg.Process.Id, RevolutionData.Context.Entity.Events.EntitySetLoaded), msg.Process, Source), Source); } } catch (Exception ex) { PublishProcesError(msg, ex, typeof(IEntitySetLoaded <TEntity>)); } }
public static void LoadEntitySet(ILoadEntitySet <TEntity> msg) { typeof(EntityRepository <, ,>).MakeGenericType(typeof(TEntity), EntityType, ctxType) .GetMethod("LoadEntitySet") .Invoke(null, new object[] { msg }); }
public static void LoadEntitySet <TEntity>(this ILoadEntitySet <TEntity> msg) where TEntity : class, IEntity { EF7DataContext <TEntity> .LoadEntitySet(msg); }