Skip to content

Commit b3b3ed1

Browse files
structure / occurrences, like DevExpress#613
1 parent 3317c52 commit b3b3ed1

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

net/Sample/Controllers/NorthwindController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public async Task<IActionResult> Orders(DataSourceLoadOptions loadOptions) {
2626
//----------------------------------------
2727
o.OrderDateOnly,
2828
o.OrderTimeOnly,
29+
o.OrderDateTimeOffset,
2930
//----------------------------------------
3031
o.Freight,
3132
o.ShipCountry,

net/Sample/Models/Order.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public Order() {
3333

3434
public TimeOnly? OrderTimeOnly { get; set; }
3535

36+
public DateTimeOffset? OrderDateTimeOffset { get; set; }
37+
3638
//----------------------------------------
3739

3840
[Column(TypeName = "datetime")]

net/Sample/SQL.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ ALTER TABLE [Orders]
99
ADD [OrderTimeOnly] time NULL
1010
GO
1111
UPDATE [Orders] SET [OrderTimeOnly] = CONVERT(time, DATEADD(hour, ([OrderID] + 1), [OrderDate]))
12+
GO
13+
ALTER TABLE [Orders]
14+
ADD [OrderDateTimeOffset] datetimeoffset NULL
15+
GO
16+
UPDATE [Orders] SET [OrderDateTimeOffset] = TODATETIMEOFFSET([OrderDate], ((([OrderID] + 1) % 27) - 12))
1217

1318
---
1419

15-
dotnet add package Microsoft.EntityFrameworkCore.Tools
16-
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
20+
dotnet package add Microsoft.EntityFrameworkCore.Tools --project Sample
21+
dotnet package add Microsoft.EntityFrameworkCore.SqlServer --project Sample
1722

18-
Scaffold-DbContext "Data Source=(localdb)\MSSQLLocalDB; Database=Northwind; Integrated Security=True; MultipleActiveResultSets=True; App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
23+
Scaffold-DbContext "Data Source=(localdb)\MSSQLLocalDB; Database=Northwind; Integrated Security=True; MultipleActiveResultSets=True; App=EntityFramework" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models1

net/Sample/Views/Home/Index.cshtml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
//groupInterval: "quarter" // N|A
5454
}
5555
},
56+
{
57+
dataField: "orderDateTimeOffset",
58+
dataType: "date",
59+
headerFilter: {
60+
groupInterval: "quarter"
61+
}
62+
},
63+
5664
{
5765
dataField: "freight",
5866
headerFilter: {

0 commit comments

Comments
 (0)