Are there any frameworks that allow a RESTful API Server to be written in C#?
I have seen MVC 4, however this seems to be providing a view that you can see in the browser, I just require the API server and no view. It would be great if it was able to provide a streaming API too.
Thanks
If you are using .NET Framework 4.5 you can use Web API
If you are using .NET Framework 3.5 I highly recommend ServiceStack
If you are using .NET Core then you can use ASP.NET Core Web API
Nancy is a free REST framework for C#.
If you are working in .NET 4.0 or higher and looking for a pre-existing REST server solution that you can plug into (which it sounds like you are), you might want to check out Grapevine. You can get it using NuGet, and the project wiki has lots of sample code.
I am the project author, and I had a similar need as the one you described. Using resources I found here and elsewhere, I built Grapevine so that I would have a solution in my back pocket whenever I needed it again (DRY).
If you are ok with using IIS to host your app, WebAPI is the route to go, per the above answers. Not every solution is best in IIS however.
For executable apps (such as a windows service), consider using WebServicesHost. This page is a good example of how to implement it.
You can use web api, it is part of the .net MVC framework but it is relying on the razor engine (inly if you use the mvc templating engine cshtml).
If you are using .net 4.0 you can use web api 1,
If you are you .net 4.5 you can use web api 2
2022, no IIS/ASP answer:
Consider EmbedIO (and probably SWAN on top of that)
A tiny, cross-platform, module based, MIT-licensed web server for .NET Framework and .NET Core.
Related
I'm trying to use the strangler fig pattern to migrate a legacy Net Framework MVC app in stages. I heard a talk by Mark Rendle about using YARP to migrate a Webforms app this way, which was great. However, I can't find any examples anywhere of using this methodology to migrate from a Net Framework MVC app to new Net 6 MVC app.
I've managed to set up the basic proxy which is working (see example repo below). However I don't know where to begin with flowing the Identity Authentication through from the Net 6 App to the Net Framework app. I can see that the auth cookie is passed through to the proxied Net Framework app, but I don't know how to take that and say "hey use this" in the Framework app.
Links:
Example Repo
Microsoft YARP Proxy
Strangler fig Pattern (Microsoft Doc)
Any pointers on how to achieve this authentication flow would be greatly appreciated.
Microsoft must have been getting this a lot...
They have created a new nuget package (currently in preview):
Microsoft.AspNetCore.SystemWebAdapters
And have an article on its use (thanks Mike Rousos!):
https://devblogs.microsoft.com/dotnet/incremental-asp-net-migration-tooling-preview-2/
I have updated my example git repo and reworked a few bits and everything seems to be working as expected.
Happy days.
I have created 2 separate projects a Web API and MVC as a Web Client. I wanted to add an external login for my web client, and now I'm confused on which project I should put the Identity stores.
By the way I am using .Net Core 3.1 with VS Code as my editor.
This question is not complete (there is not enough information on how You going to use API).
In most cases, the .Net Core Identity system should be used in an API, since often APIs contain the main logic of the application being implemented, and clients are just interaction interfaces (of which there can be several, for example, a mobile application and a web interface).
You also mentioned that You are using VS Code as code editor. It doesn't have built-in code generation capabilities like VS does, but you can still use dotnet CLI codegenerators (e.g. ASP Identity scaffolding).
I have an existing asp.net mvc application (Pivotal) with its own authentication mechanism. I want to use this as a Security Token Service for Windows Identity Foundation so that other related web applications can use Pivotal for authentication.
The WIF docs claim that a web app can be used as a STS, but provide no examples. I can't find anything online that relates to the current versions .net/WIF. I am using VS 2017, .net 4.52, c# and MVC 5. The examples that I have found related to VS2012 and don't work in VS2017.
Are there any guides or examples that can help?
Totally agree with "don't roll your own" but if you want to, refer this.
Then convert 3.5 to 4.5.
In my ASP.NET Core 2.0 Web API (on .NET Core) I want to call functions from another ASP.NET Core 1.1 Web API (on .NET Framework).
I can do this manually by calling the http address of the functions. But are there any tools, which generates me the classes of the other web api for better using?
I found out: The tool I need calls AutoRest: https://github.com/Azure/autorest/blob/master/README.md
There is one great tool, you can generate C# classes from JSON or url, if that is what you want.
JSON Utils
Our organization uses IBM FileNet as document management system. FileNet P8 comes with a web services API which can be used in .net
Has anyone of you guys tried this? If yes could you please direct me to any resources to kick start?
Thanks a ton in advance.
http://publib.boulder.ibm.com/infocenter/p8docs/v4r5m1/index.jsp?topic=/com.ibm.p8.doc/developer_help/content_engine_api/guide/gs_procedures.htm
The FileNet API comes in 5 flavors:
Java - jar reference, configure to use either http or iiop transport
.NET - .NET dll reference, configure for http transport
CEWS - Content Engine Web Services. Use only if you can't use the Java or .NET API
CMIS - web service conforming to the CMIS spec
COM - semi-legacy, not discussed in the docs, but it does exist
Although the .NET API uses web services in the background, your .NET project reference is to FileNet.Api.dll, rather than directly to the WSDL. So if you're a .NET shop, you want the .NET API, not the "Web Services API" (2012-02-03 edit: unless you opt for CMIS)
The best place to get started is the "Bulk Loader Sample Code" here: http://www-01.ibm.com/support/docview.wss?rs=3278&uid=swg27010422
You're in the right place for documentation related to the P8 .Net API. The only other "kick-start" link I can think of is http://www.ecmplace.com/.
I know how to create a session using the Java API for the CE, but I'm sorry to say that I haven't done it with the .Net API. However, I'm fairly certain that you'll find helpful examples on the ECM Place forum.
HTH!
Tom Purl