public static TEntity Find <TEntity, TOptions>( this ICrudService <TEntity, TOptions> service, TEntity entity, object context = null) where TEntity : IEntity where TOptions : ICrudServiceOptions => service.Find(service.CreateEqualityComparerExpression(entity), context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context));
public static TSelect Find <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.Find(predicate, select, context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context));
public static Task <TSelect> FindAsync <TEntity, TOptions, TSelect>( this ICrudService <TEntity, TOptions> service, TEntity entity, Expression <Func <TEntity, TSelect> > select, object context = null) where TEntity : IEntity where TOptions : ICrudServiceOptions => Task.Run(() => service.Find(service.CreateEqualityComparerExpression(entity), select, context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context)));
public IActionResult PostAsync([FromBody] WorkdsInRelationship body) { var result = crudService.Find(); if (result == null) { return(BadRequest()); } return(Ok(result)); }
public static Task <TEntity> FindAsync <TEntity, TOptions>( this ICrudService <TEntity, TOptions> service, Expression <Func <TEntity, bool> > predicate, object context = null) where TEntity : IEntity where TOptions : ICrudServiceOptions => Task.Run(() => service.Find(predicate, context == null ? DefaultCrudServiceOptions.Default <TOptions>() : DefaultCrudServiceOptions.FromContext <TOptions>(context)));