I am building simple LOB application (online restaurant reservation application) and i want to support multiple client side application types like web site, windows desktop application, android application etc. So i think that best way to design system is to separate ASP.NET 5 WebApi which will provide interaction with database, authorization and stuff like that and than build separate solution with projects for client applications which will consume that API. One of those client applications would be Silverlight application. Problem is, how i consume my API from Silverlight application. I can't find any information to link Silverlight with ASP.NET 5. All i got isMVC6. Is it better to createASP.NET MVC6application, implement my APIs there and hostSliverlight` in that project or to separate it like i described?
Silverlight is dead, but it can easily consume REST API so why cannot it work with ASP.NET Core 1.0?
There is no need to have special documentation.
Related
I'm mostly back end developer and want to start small side project.
I want to do razor pages web app and as a part of it I would like to have web api that can be consumed outside of the app and if I want, use it to build other front end with it.
What would be good project structure? I don't want to have it deployed as 2 apps. One for razor, second for web API. I would like to have it as a one deployed app.
Is this good approach?
Thanks
I tried separate razor pages app and separate web api. Deployed as two pages.
Since you're building a Web API project anyway, you should consider making a frontend application with a framework like Vue that interacts with the API, instead of a Razor project. Having both a Razor project and a Web API project would be redundant as both of them would have to incorporate most of the same backend code.
It better separates the role of the frontend and backend applications, and Microsoft's documentation suggests using this project structure too.
You'd have to deploy two separate apps, but this would be a more suitable approach.
If you still want to deploy one application only, you could just incorporate Web API services in your Razor app, but this really isn't recommended.
I have a simple server app that I need to re-write. Basically, uses async TCPSockets to allow multiple clients to connect & communicate asynchronously. Right now it is running as a winforms app & is managed as a windows service. I'm trying to decide if I should rebuild it in a similar way using WPF, or should I rebuild as an IIS MVC4 WebAPI app. I like all of the monitoring options & memory management built into IIS. This is definitely more familiar territory to me.
I'll need a nice GUI interface to see realtime statistics but this should be do-able as a web app. Is there any reason I wouldn't use MVC4 web API?
I have a desktop webscraper application written using C#.NET.
It works very simply. The user imports input data in txt/csv/Excel. The app exports scraped and orginized results in an output file (csv, html).
How can I make this accessible online, as a website?
I haven't done web programming before (only desktop) and I do not know any web programming languages. But I think I can learn ASP.NET and create similar webscraper functionality with it.
What kind of webhosting requirements do I have?
What you need to do is turn your desktop application into a library. Turn your EXE into a DLL with an API that does specific functions. This means separating functional operations from UI operations. Then, build a web application that uses this library to offer the same functionality online.
If you want to learn something new to build web applications, I suggest ASP.NET MVC and not ASP.NET Web Forms. MVC is much closer to web development than web forms.
As for web hosting requirements, Any web host that support ASP.NET should be able to run ASP.NET MVC.
I have done a little with ASP.NET but I think this will help you
I have say 3 projects: one the MVC2 app, the second is Windows Service and dll library which is used by Service. I can install and uninstall the service to the system but I need the MVC to be "on" when the service is up and "off" when it is down.
Any other things like IIS is way more appropriate but lets say they are unavailable.
Sorry for my english. In other words, I need to host MVC web app inside my C# Windows Service.
ASP.NET MVC just introduced self-hosting with MVC4 because it replaced the WCF Web API. Before this MVC was oriented towards human-readable websites and not web services, so it didn't make sense to have self-hosting til now. Here is the article. If you are limited to MVC2 then I don't believe this is possible.
I don't think you can host MVC iniside a windows service. You'd just be making your life very difficult. If you you want to bypass IIS you would have to write your own webhosting service.
We are developing a Silverlight app with long-running workflows that need to be persisted, tracked and versioned. Should we use a workflow service (hosted on AppFabric) or have it as part of the ASP.NET web-app?
That really depends on what you are doing with the workflows. If the Silverlight client is doing all workflow interaction then using a workflow service is the way to go. On the other hand if other parts of you ASP.NET code are working with the workflow hosting them direcetly might be a better option.
Even if you use workflow services you can host them as part of your ASP.NET app, no need to create another app for that. And regardless of where you host things you can use the workflow service both from your Silverlight code as well as from your ASP.NET server side code.