Skip to content

Commit 31710ff

Browse files
committed
fix
1 parent d3c94c0 commit 31710ff

15 files changed

+101
-86
lines changed

CS/ODataService/Controllers/ActionsController.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
1+
using System.Linq;
52
using DevExpress.Xpo;
6-
using Microsoft.AspNet.OData;
7-
using Microsoft.AspNet.OData.Routing;
83
using Microsoft.AspNetCore.Mvc;
4+
using Microsoft.AspNetCore.OData.Routing.Controllers;
5+
using Microsoft.AspNetCore.OData.Routing.Attributes;
96
using ODataService.Helpers;
107
using ODataService.Models;
118

@@ -16,15 +13,15 @@ public class ActionsController : ODataController {
1613
public ActionsController(UnitOfWork uow) {
1714
this.Session = uow;
1815
}
19-
[ODataRoute("InitializeDatabase")]
16+
[Route("odata/InitializeDatabase")]
2017
public IActionResult InitializeDatabase() {
2118
DemoDataHelper.CleanupDatabase(Session);
2219
DemoDataHelper.CreateDemoData(Session);
2320
return Ok();
2421
}
2522

2623
[HttpGet]
27-
[ODataRoute("TotalSalesByYear(year={year})")]
24+
[Route("odata/TotalSalesByYear(year={year})")]
2825
public IActionResult TotalSalesByYear(int year) {
2926
decimal result = Session.Query<Order>()
3027
.Where(o => o.Date.Value.Year == year)

CS/ODataService/Controllers/ContractController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
using System;
22
using System.Linq;
33
using DevExpress.Xpo;
4-
using Microsoft.AspNet.OData;
54
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.AspNetCore.OData.Deltas;
6+
using Microsoft.AspNetCore.OData.Formatter;
7+
using Microsoft.AspNetCore.OData.Query;
8+
using Microsoft.AspNetCore.OData.Results;
9+
using Microsoft.AspNetCore.OData.Routing.Controllers;
610
using ODataService.Helpers;
711
using ODataService.Models;
812

CS/ODataService/Controllers/CustomerController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
using System;
22
using System.Linq;
33
using DevExpress.Xpo;
4-
using Microsoft.AspNet.OData;
54
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.AspNetCore.OData.Deltas;
6+
using Microsoft.AspNetCore.OData.Formatter;
7+
using Microsoft.AspNetCore.OData.Query;
8+
using Microsoft.AspNetCore.OData.Results;
9+
using Microsoft.AspNetCore.OData.Routing.Controllers;
610
using ODataService.Helpers;
711
using ODataService.Models;
812

CS/ODataService/Controllers/DocumentsController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
using System;
22
using System.Linq;
33
using DevExpress.Xpo;
4-
using Microsoft.AspNet.OData;
54
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.AspNetCore.OData.Formatter;
6+
using Microsoft.AspNetCore.OData.Query;
7+
using Microsoft.AspNetCore.OData.Results;
8+
using Microsoft.AspNetCore.OData.Routing.Controllers;
69
using ODataService.Helpers;
710
using ODataService.Models;
811

CS/ODataService/Controllers/OrderController.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using System;
22
using System.Linq;
33
using DevExpress.Xpo;
4-
using Microsoft.AspNet.OData;
5-
using Microsoft.AspNet.OData.Routing;
64
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.AspNetCore.OData.Deltas;
6+
using Microsoft.AspNetCore.OData.Formatter;
7+
using Microsoft.AspNetCore.OData.Query;
8+
using Microsoft.AspNetCore.OData.Results;
9+
using Microsoft.AspNetCore.OData.Routing.Controllers;
710
using ODataService.Helpers;
811
using ODataService.Models;
912

@@ -100,7 +103,7 @@ public IActionResult Patch([FromODataUri] int key, Delta<Order> order) {
100103

101104
[HttpPost]
102105
[HttpPut]
103-
[ODataRoute("Order({key})/OrderDetails")]
106+
[Route("Order({key})/OrderDetails")]
104107
public IActionResult AddToOrderDetails([FromODataUri] int key, OrderDetail orderDetail) {
105108
Order order = Session.GetObjectByKey<Order>(key);
106109
if(order == null) {

CS/ODataService/Controllers/OrderDetailController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
using System.Linq;
22
using DevExpress.Xpo;
3-
using Microsoft.AspNet.OData;
43
using Microsoft.AspNetCore.Mvc;
4+
using Microsoft.AspNetCore.OData.Deltas;
5+
using Microsoft.AspNetCore.OData.Formatter;
6+
using Microsoft.AspNetCore.OData.Query;
7+
using Microsoft.AspNetCore.OData.Results;
8+
using Microsoft.AspNetCore.OData.Routing.Controllers;
59
using ODataService.Helpers;
610
using ODataService.Models;
711

CS/ODataService/Controllers/ProductController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
using System;
22
using System.Linq;
33
using DevExpress.Xpo;
4-
using Microsoft.AspNet.OData;
54
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.AspNetCore.OData.Deltas;
6+
using Microsoft.AspNetCore.OData.Formatter;
7+
using Microsoft.AspNetCore.OData.Query;
8+
using Microsoft.AspNetCore.OData.Results;
9+
using Microsoft.AspNetCore.OData.Routing.Controllers;
610
using ODataService.Helpers;
711
using ODataService.Models;
812

CS/ODataService/Helpers/ApiHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
using System.Collections;
33
using System.Net;
44
using DevExpress.Xpo;
5-
using Microsoft.AspNet.OData;
65
using Microsoft.AspNetCore.Http;
6+
using Microsoft.AspNetCore.OData.Deltas;
77

88
namespace ODataService.Helpers {
99
public static class ApiHelper {

CS/ODataService/Helpers/UriHelper.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Linq;
4-
using Microsoft.AspNet.OData;
5-
using Microsoft.AspNet.OData.Extensions;
6-
using Microsoft.AspNet.OData.Routing;
73
using Microsoft.AspNetCore.Http;
8-
using Microsoft.AspNetCore.Mvc.Routing;
94
using Microsoft.OData.UriParser;
105
using ODataService.Models;
116

CS/ODataService/Models/SingletonEdmModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using DevExpress.Data.Filtering;
22
using DevExpress.Xpo;
33
using DevExpress.Xpo.Metadata;
4-
using Microsoft.AspNet.OData.Builder;
54
using Microsoft.OData.Edm;
5+
using Microsoft.OData.ModelBuilder;
66
using ODataService.Helpers;
7-
using System;
8-
using System.Collections.Generic;
97
using System.Linq;
108

119
namespace ODataService.Models {

0 commit comments

Comments
 (0)