c# - Add existing Web Api project to existing Mvc project -
i have 2 projects in solution, mvc project , web api project. best way go utilizing web api project within mvc application? options have come far: deploy both projects , use helper class interact api (javascript or server side) add reference web api project adds api functionality mvc project (not sure how integrate api project mvc project correctly, how this?) if there better alternative please share. in folder controllers have files this: namespace beerdev.controllers { public class homecontroller : controller { public actionresult index() { viewbag.title = "home"; return view(); } } } and create folder called controllersapi files this: namespace beerdev.controllersapi { public class homecontroller : apicontroller { public ihttpactionresult get() { string beers; using (streamreader sr = new streamreader(hostingenvironment.mappath("~/mo...