1
votes

I'd like to be able to have my BreezeController on the server side also be accessible by standard OData clients. I saw there was a question almost a year ago that was answered saying this was coming to breeze here. However, when I point an OData client (such as LinqPad or Excel) to my server it has an issue since the metadata isn't correct. This is even after changing the metadata action name on the controller to "$metadata". Am I correct in believing that a Breeze WebApi2 controller can act as an odata endpoint?

1

1 Answers

1
votes

Hang in there, @cobywhite. We're about to release a Web API 2 OData sample that will show you how. Maybe by end of this week or top of next week.

You will have to make a small change on the OData server to get it to deliver the proper metadata. Are you able to do that?

As for reusing the "BreezeController" ... that's going to be tricky. OData is very particular about having its own controllers. I think you'll have to write those too. Make sure you don't put any business logic in any of your controllers. You shouldn't be doing that under any circumstances but now it will be imperative.

Always delegate to a repository or unit-of-work-and-repositories. The controllers should focus exclusively on their roles as vehicles and gatekeepers for communication with clients.