1
我有這個控制器在我的asp.net網站API應用程序:Json的類型沒有在asp.net的Web API應用程序發現
using AutoMapper;
using Microsoft.AspNet.Identity.EntityFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin.Security;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web;
using System.Web.WebPages.Html;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Net.Mail;
namespace AjTransport.webApi.Controllers
{
public class AccountManageController : ApiController
{
[AllowAnonymous]
public System.Web.Mvc.JsonResult FindUser(string str)
{
var result = UserManager.FindByName(str) ?? UserManager.FindByEmail(str);
return Json(result == null, System.Web.Mvc.JsonRequestBehavior.AllowGet);
}
}
}
的問題是在這裏
返回JSON(結果= = null,System.Web.Mvc.JsonRequestBehavior.AllowGet);
類型未找到Json。所以我需要知道我該如何解決這個問題?