I've been using ResponseType attribute from System.Web.Http.Description namespace. It helps swagger to generate the client side models. But this is now missing from MVC 6. Is there any other attribute which has replaced this?
Here's a great article about everything dot net core for asp.net https://docs.asp.net/en/latest/tutorials/web-api-help-pages-using-swagger.html
But to get you started try the ProducesResponseType attribute.
Related
I am working in project that I need to use to get products data by category .The problem is when I get the products data it is big data it is around 16000 record when I sent it back to ajax call it hangs .So I think the problem from json MaxJsonDeserializerMembers property witch I cannot find in mvc core2.2.
I found Solution that said add this line
<add key="aspnet:MaxJsonDeserializerMembers" value="150000"/>
to webconfig but in mvc core 2.2 there is no webconfig.
It's a known issue in here , as JamesNK said in that discussion , There is no equivalent to aspnet:MaxJsonDeserializerMembers in Json.NET. The only limit is depth.
I am looking for a solution to dynamic configure the routing in ASP.NET MVC 3, based on the current language the user is using on the website.
now i have:
domain.com/de/controller/action/subaction/XX
domain.com/en/controller/action/subaction/XX
and i would like to have:
domain.com/de/bereich/aktion/unteraktion/XX
domain.com/en/controller/action/subaction/XX
the name for the controller/action & subaction should be configurable through the Database (the german names as well as the english ones)
As the default route configuration works well in ASP.NET MVC, i would prefer to use it, and e.g. just customize the class that handles the mapping between the URL and the controller (etc).
http://blog.maartenballiauw.be/post/2010/01/26/Translating-routes-%28ASPNET-MVC-and-Webforms%29.aspx this article will help you exactly with your problem but please think about it twice.
I'd like to make the following thing in my webisite
Could anybody suggest me a way? I can't find any example.
UPDATE: Here's what I'd like to do in asp.net mvc 3 - http://encosia.com/blog/media/images/inline-text-editing.gif
Here you can see an Example using ASP.NET (not MVC) but you can reuse their javascript logic at least.
EDIT:
Here you can see a working example in MVC... hope this helps!
I'm doing my first ASP.NET MVC 3 project here, and since I need to support stored procedures, I decided to use Entity Framework 4.1 with the "database-first" approach, e.g. with all the EDMX goodness.
Since I absolutely need the stored procedure support, I cannot use code-first (as much as I'd love to).
All the cool new MVC scaffolding stuff seems to be based on code-first (which I cannot use - see above) -- or is there a way / a setting to influence it so that it'll use ObjectContext instead of DbContext??.
So how do I create a quickie section of my MVC 3 app to scaffold some lookup tables - using the EF 4.1 database-first approach? Can I use dynamic data? How do I add this to an existing MVC 3 (.NET 4) project?? Can't seem to find any "add new item" entry for dynamic data..... and all the how-to videos I find are for MVC 1 or 2 and .NET 3.5 - do they still apply??
Please see this comment at here. I think you should customize the T4 template for your business. And Stev also have a good article at here.
It ended up being impossible to use the built-in scaffoling for ASP.NET MVC 3 without an outrageous amount of extra work - so I ended up going back to ASP.NET Webforms for this little project of mine.
Hope you had tried this:
Scaffold Controller Participant -force -repository -DbContextType "DBEntities"
where DBEntities is the name of model class generated by entity framework.
I need to render an ASP.NET MVC view to a string so as to be able to send it via an email (it is an order confirmation email defined in an .ascx file ).
I've successfully been able to render an ASP.NET MVC View to string using one of the methods in this question.
However now I need to be able to do it via a WCF service (that will be accessed via silverlight) and so I don't have a ControllerContext. This WCF service is contained within the same project as my MVC project so has access to all my models etc.
I've looked at several questions on Stackoverflow about this issue, but they all seem to need a controller context. I thought there was something in mvccontrib but it doesn't seem to be there anymore.
The closest I've found is the accepted answer to the aforementioned question, but it unfortunately breaks with RenderPartial within the view you're rendering.
I'm hoping maybe some of the behind the scenes work for ASP.NET MVC 2 related to RenderAction may help make this possible now?
BuildStarted and I have put together a standalone Razor templating engine which you might find useful (Github). You'll need to adapt your .ascx content into a simple string template, but it should do the job.
If you've got NuGet, you can run Install-Package RazorEngine
You may checkout the following blog post. Also Postal is worth looking at.
You need to create a fake HttpContextBase with a fake HttpRequestBase that return meaningful values from their properties.