Comments (13)
Thanks for reporting with the example code, I'll check it asap
from autofilterer.
Hand-written query expression is compiled as filter.CreateTime.Min <= Convert(x.CreateTime, Nullable'1)
instead x.CreateTime >= 2023-08-12 3:17:30 PM
It's probably a Nullable check problem. I'll work on it
from autofilterer.
This issue occurs in sqlserver 2016
from autofilterer.
It's probably happened after PR #69
from autofilterer.
It works with SqlServer provider, can you provide me which Entity Framework provider do you use in this case?
from autofilterer.
SqlServer
from autofilterer.
abp project file
MyAbpEntityFrameworkCoreModule.cs
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<ManageDbContext>(options =>
{
options.AddDefaultRepositories(includeAllEntities: true);
});
context.Services.AddAbpDbContext<MyAbpDbContext>(options =>
{
options.AddDefaultRepositories(includeAllEntities: true);
});
Configure<AbpDbContextOptions>(options =>
{
options.UseSqlServer();
});
}
ManageDbContext
[ConnectionStringName("manage")]
public class ManageDbContext: AbpDbContext<ManageDbContext>
{
public ManageDbContext(DbContextOptions<ManageDbContext> options)
: base(options)
{
}
public DbSet<ProjectInfo> ProjectInfos { get; set; }
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.Entity<ProjectInfo>(b =>
{
b.ToTable(MyAbpConsts.DbTablePrefix + "ProjectInfo");
b.ConfigureByConvention();
});
}
}
ProjectInfoAppService
public class ProjectInfoAppService : CrudAppService<ProjectInfo, ProjectInfoDto, Guid, ProjectInfoGetListInput, CreateUpdateProjectInfoDto, CreateUpdateProjectInfoDto>, IProjectInfoAppService
{
public ProjectInfoAppService(IRepository<ProjectInfo, Guid> repository) : base(repository)
{
}
protected override async Task<IQueryable<ProjectInfo>> CreateFilteredQueryAsync(ProjectInfoGetListInput input)
{
return (await base.CreateFilteredQueryAsync(input)).ApplyFilter(input);
}
}
from autofilterer.
Here's the problem .0000000
SELECT COUNT(*)
FROM [StockInfo] AS [s]
WHERE CASE
WHEN [s].[CreateTime] >= '2024-06-01T00:00:00.0000000' THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END & CASE
WHEN [s].[CreateTime] <= '2024-06-29T00:00:00.0000000' THEN CAST(1 AS bit)
ELSE CAST(0 AS bit)
END = CAST(1 AS bit)
from autofilterer.
It's generated by the EF Core provider. AutoFilterer doesn't generate SQL queries. It generates only LINQ expressions.
Does it work when you write it manually like below?
.Where(x => x.CreationTime <= DateTime.Now)
from autofilterer.
.Where(x => x.CreationTime <= DateTime.Now)
The execution was successful
from autofilterer.
protected override async Task<IQueryable<StockInfo>> CreateFilteredQueryAsync(StockInfoGetListInput input)
{
return (await base.CreateFilteredQueryAsync(input))
.Where(x => x.CreateTime > input.CreateTime.Min && x.CreateTime < input.CreateTime.Max);
//.ApplyFilter(input);
}
from autofilterer.
Which AutoFilterer version are you currently using? This has to be parameterized after PR #59
from autofilterer.
3.0.0
from autofilterer.
Related Issues (20)
- Heavy Reporting App Sample
- Improvement on Collection Filters HOT 3
- Performance Improvement on Attribute usages
- Consider using IIncrementalGenerator interface HOT 1
- String Not Contains Filter HOT 1
- CodeFactor found an issue: Complex Method HOT 1
- Enable Source Linking
- Dependency Injection Compatibility
- FromQuery Error: InvalidOperationException: No public static bool GenericFilter.TryParse(string, out GenericFilter) method found for filter. HOT 5
- Composite search filter can not search for Enums. HOT 6
- Range<DateTime> System.InvalidOperationException HOT 1
- Provide option to not throw exception when Sort option is not valid HOT 1
- about PaginationFilter return query result. HOT 3
- Enhancement request: Support Generics for FilteringOptionsBaseAttribute in Custom Expression for a Property HOT 7
- bug? not execute Custom Expression HOT 9
- documentation url return 404 HOT 2
- Array search filters on an empty array break queries with CombineWith.Or HOT 2
- Bug: constants instead of parameters HOT 6
- Decision: Dropping `AutoFilterer.Dynamics` support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autofilterer.