Ejemplo n.º 1
0
        public override object BeforeMethod(string method)
        {
            if (method.StartsWith(MethodHandle))
            {
                if (!(_wrapee is EntityLiquidAdapter entity))
                {
                    return(_wrapee.InvokeDrop(method));
                }

                _entities = Container.GetInstance <IEntityDataService>();

                var options = GetLoadOptions(method);

                return(_entities.Query.IncludeNecessaryData()
                       .Where(x => x.PrimaryCategoryId == entity.Entity.PrimaryCategoryId && x.Id != entity.Id)
                       .GetWithAppliedOrder(options.Order)
                       .GetWithApliedTimeRange(options.TimeRange)
                       .Take(options.Count).ToList()
                       .AsLiquidAdapted());
            }

            return(_wrapee.InvokeDrop(method));
        }