Example #1
0
        // GET: Home/Details/5
        public async Task <IActionResult> Details(int id)
        {
            try
            {
                Specification.AddFilter(i => i.Id == id);
                Specification.AddInclude(e => e.MainCategory);
                Specification.AddInclude(z => z.SubCategory);
                var objList = await ProductRepo.GetFirstBySpecsAsync(Specification);

                return(PartialView(objList));
            }
            catch (Exception e)
            {
                this.ILogger.LogError("Error Occurred While Running Details @ HomeController : \n" + e.Message);
                return(BadRequest());
            }
        }
        public ICanAddInclude <T> Include(Expression <Func <T, object> > spec)
        {
            _baseQuery.AddInclude(spec);

            return(this);
        }