0

Hello Stackers,

I have an Asp.net Mvc and i wanna migrate the index page from it to an Web Api i wanna know if there is any pattern or approach to follow for making it more easy. i google it but i didn't found a useful answer.

Any answer will be appreciate it.

Thanks

1
  • 1
    The spec for Web API and MVC are very similar so I would start by simply changing your controllers to inherit from ApiController rather than Controller i.e. MyController : ApiController. Check out this doc from Microsoft. Commented Sep 6, 2020 at 2:21

1 Answer 1

1

I am not sure if there is a pattern, but next some steps that could help.

  • Group all your services that returns, saves, delete or do some work in the backend. On your backend you could create a new layer (New project or new namespace) to call the existing ones and export those services as Web API endpoints.
  • On your frontend check how are you going to consume your Web API services. I mean if you are going to call it directly with javascript or maybe using some library or framework.

Those are going to be the first steps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.