Posted on: 10/20/2014 1:30:46 PM | Views : 403

Hi all,
           I have role controller with a get wepapi like below
public IEnumerable<IdentityRole> Get() { IEnumerable<IdentityRole> objRoles = RoleManager.Roles; return objRoles; } And i am consuming this method in mvc controller like below
protected string UrlBase = "http://localhost:2483/"; protected string Uri = "api/Role/"; // GET: Role public ActionResult Index() { HttpClient client = new HttpClient(); client.BaseAddress = new Uri(UrlBase); var response = client.GetAsync(Uri).Result; List<ApplicationRole> result = JsonConvert.DeserializeObject<List<ApplicationRole>>(response.Content.ReadAsStringAsync().Result); return View(result); } ...

Go to the complete details ...