【发布时间】:2016-02-29 20:24:10
【问题描述】:
我的 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);
}
}
}
问题来了
return Json(result == null, System.Web.Mvc.JsonRequestBehavior.AllowGet);
找不到类型 Json。所以我需要知道如何解决这个问题?
【问题讨论】:
标签: c# asp.net json asp.net-mvc asp.net-web-api