The ComponentOne Web API Edition is a set of API's that are available as Visual Studio templates with support for ASP.NET Core 2.0 and ASP.NET Core 3.0 Web API.
This topic demonstrates how to create a Web API service application using ComponentOne template in Visual Studio. This builds the server side (or endpoint) for a client application. The client application sends a request to the endpoint for accessing its service and gets a response in return.
In this new project, ComponentOne template adds the references C1.Web.Api.dll, C1.C1Excel.dll and other related assemblies.
Your server-side application is successfully created. You can now use the generated URL of launched Web API service to make a call to the service project from your client application. You can use Web API services such as Report, Excel, Image and Barcode in the client application. For more information, see Services topic.
The following image shows a hosted Web API service application in browser.
In the example above, the service has been hosted at https://developer.mescius.com/componentone/demos/aspnet/c1WebAPI/latest/.
Once you have successfully hosted a Web API URL for Services, you can access and call these Web API service for exporting and importing excel files, excel images, generate excel from given data and template, and generating barcode from a given text. For more information on how to work with Web API Services, see Services topic.
public void ConfigureServices(IServiceCollection services)
{
...
services.AddC1Api();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
app.UseC1Api();
...
}