|
15 | 15 |
|
16 | 16 | //$Authors = Jiri Cincura (jiri@cincura.net) |
17 | 17 |
|
| 18 | +using System; |
18 | 19 | using System.Data.Common; |
| 20 | +using System.Linq; |
19 | 21 | using System.Threading.Tasks; |
20 | 22 | using FirebirdSql.Data.FirebirdClient; |
21 | 23 | using FirebirdSql.EntityFrameworkCore.Firebird.FunctionalTests.Helpers; |
| 24 | +using Microsoft.EntityFrameworkCore; |
22 | 25 | using Microsoft.EntityFrameworkCore.Query; |
23 | 26 | using Microsoft.EntityFrameworkCore.TestUtilities; |
24 | 27 | using Xunit; |
@@ -151,6 +154,23 @@ public override Task SqlQueryRaw_queryable_simple_different_cased_columns_and_no |
151 | 154 | return base.SqlQueryRaw_queryable_simple_different_cased_columns_and_not_enough_columns_throws(async); |
152 | 155 | } |
153 | 156 |
|
| 157 | + [Fact] |
| 158 | + public async Task Where_datetime_between_translated_correctly() |
| 159 | + { |
| 160 | + using var context = CreateContext(); |
| 161 | + |
| 162 | + var inicio = new DateTime(2026, 1, 1); |
| 163 | + var fim = new DateTime(2026, 1, 31); |
| 164 | + |
| 165 | + var query = context.Orders |
| 166 | + .Where(o => o.OrderDate >= inicio && o.OrderDate <= fim); |
| 167 | + |
| 168 | + var sql = query.ToQueryString(); |
| 169 | + |
| 170 | + Assert.Contains("BETWEEN", sql); |
| 171 | + Assert.Contains("AND", sql); |
| 172 | + } |
| 173 | + |
154 | 174 | protected override DbParameter CreateDbParameter(string name, object value) |
155 | 175 | => new FbParameter { ParameterName = name, Value = value }; |
156 | 176 | } |
0 commit comments