It's a bit hard to answer your question without more information on what you are trying to do.
You should however note that if you just copy a controller class from a normal ASP.NET project into a Umbraco solution it will not "just work".
Controllers routes needs to be registrered for controller actions to be hit. This usually happens by auto-routing on /controller/action/id
URLs in your site for MVC and /api/controller/id
for WebAPI controllers.
This auto-routing is not enabled by default in a Umbraco site so you would have to manually do something similar to what happens in the RouteConfig.cs
/ WebApiConfig.cs
to route controllers and be able to reach them.
You should however also look into using the UmbracoApiController
which will most likely be the easiest solution for you. If you make your controller inherit from this, it will get auto-routed by Umbraco on a /Umbraco/Api/[YourControllerName]
URL and you should be able to reach it. The cool thing about using the UmbracoApiController
is that it is just the same as a normal WebAPI controller, with the added benefit of being able to reach the Umbraco context/services.
You can see documentation on the webapi/routing stuff here:
https://our.umbraco.org/documentation/reference/routing/webapi/