domain driven design - Automatically Wrap a Controller Around a Service in ASP.NET MVC -


The question title can not be clear but what I want to do is something like this:

How do I layer my app

App.domain app. Services App Web

What do I need, if I get the / API / order processor / gateall order from this method GetAllOrder in App Services.OrderProcessorService will call .

Method One IList & lt; Order & gt; and I want to get it sorted in JSON according to a certain format (I'm actually using ExtJS), maybe something like:

  {Success: right, Total number: 10, list: [{...}, {...}}}  

I can walk and make services as controllers, but I do not want to That the service layer is contaminated with the presentations.

How can I go about creating a cover controller like this?

I do not want to add any attributes to the service class, and it would be good to be able to configure it using IOC, where I want to have the output XML or potential capacity To use the DTO class instead of the original domain class.

Any thoughts?

It seems as if you are trying to create one

one Using the conditional service, the / api / orderprocessor / getAllOrders URI will return your JSON objects.

If this is the case, then I will use WCF instead of ASP.NET MVC.

To get started with WCF, REST, and JSON, look at Codeplex.

Good luck!

This is a quick example of returning JSON from the WCF service.

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -