public JsonResult GetUsers (string name, string applicationKey)
{
Configuration myWebConfig = WebConfigurationManager.OpenWebConfiguration(null);
KeyValueConfigurationElement customSetting = myWebConfig.AppSettings.Settings["IntegrationKey"];
if(customSetting!=null)
{
if(customSetting.Value==applicationKey)
{
var user = userRepository.GetByName(name);
string userName = user != null ? user.UserName : "";
int userId = user != null ? user.Id : -1;
return Json(new object[] {userName,userId});
}
}
return Json(false);
}