public static IEnumerable <TSelect> FindAll <TEntity, TOptions, TSelect>( this ICrudService <TEntity, TOptions> service, Expression <Func <TEntity, bool> > predicate, Expression <Func <TEntity, TSelect> > select, object context = null) where TEntity : IEntity where TOptions : ICrudServiceOptions => service.FindAll(predicate, select, context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context));
public static IEnumerable <TEntity> FindAll <TEntity, TOptions>( this ICrudService <TEntity, TOptions> service, IEnumerable <TEntity> entities, object context = null) where TEntity : IEntity where TOptions : ICrudServiceOptions => service.FindAll(service.CreateEqualityComparerExpression(entities), context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context));
public static Task <IEnumerable <TSelect> > FindAllAsync <TEntity, TOptions, TSelect>( this ICrudService <TEntity, TOptions> service, IEnumerable <TEntity> entities, Expression <Func <TEntity, TSelect> > select, object context = null) where TEntity : IEntity where TOptions : ICrudServiceOptions => Task.Run(() => service.FindAll(service.CreateEqualityComparerExpression(entities), select, context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context)));
public IActionResult Index() { if (HttpContext.Response.StatusCode == 401) { return(Unauthorized()); } return(View(_productService.FindAll())); }
public IActionResult Search() { var producers = _producerService.FindAll(); var types = _typeService.FindAll(); ViewBag.Producers = new SelectList(producers, "Id", "Name"); ViewBag.ComponentTypes = new SelectList(types, "Id", "Type"); return(PartialView()); }
public static IEnumerable <TSelect> FindAllRanged <TEntity, TOptions, TSelect>( this ICrudService <TEntity, TOptions> service, Expression <Func <TEntity, bool> > predicate, Expression <Func <TEntity, TSelect> > select, long skip, long take, Expression <Func <TEntity, object> > sortField = null, SortingOrder sortingOrder = SortingOrder.Ascending) where TEntity : IEntity where TOptions : IPagableCrudServiceOptionsAutomationSupport <TEntity> => service.FindAll(predicate, select, DefaultCrudServiceOptions.FromPagingParameters <TEntity, TOptions>(sortField, sortingOrder, skip, take));
public IActionResult Index() { var liquids = liquidService.FindAll(); return(View()); }
public static Task <IEnumerable <TEntity> > FindAllAsync <TEntity, TOptions>( this ICrudService <TEntity, TOptions> service, Expression <Func <TEntity, bool> > predicate, object context = null) where TEntity : IEntity where TOptions : ICrudServiceOptions => Task.Run(() => service.FindAll(predicate, context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context)));
public IActionResult Index() { var components = _componentMapper.MapCollection <ComponentDTO, ComponentVM>(_componentService.FindAll()); return(PartialView(components)); }