How to I fix "The method or operation is not implemented"?
-
When I run my code, when I want to check the user who is logged in (this is a web application), the method called is having an error saying The method or operation is not implemented. I need help to fix it by implementing the method. Here is where the error occurs
try
{
foreach (string caseNumber in userEnteredCaseNumberList)
{
EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
newCandidate.CaseNbr = caseNumber;
newCandidate.RequestorInfoID = Convert.ToInt32(requestorItem.Value);
newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail(); //Calls public static string GetADEmmail method
await CandidateCaseController.PostCandidate(newCandidate);
}
}
catch (Exception ex)//shows The method or operation is not implemented.
{
string errorMsg = string.Format("An error has occured in {0}. \nException:\n{1}", "GetCasesButton_Click()", ex.Message);
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + errorMsg + "');", true);
}Method that is called by line 8 with EntryStaffUserName. The error on on this method on line 7
public static string GetADEmail()
{
string retVal = string.Empty;
using (var context = new PrincipalContext(ContextType, "COURTS"))
{
UserPrincipal user = new UserPrincipal(context);
user = UserPrincipal.FindByIdentity(context, IdentityType, Environment.UserName);//this is where there is an issue. I can see UserName has a value
retVal = user.EmailAddress;
}
return retVal;
} -
When I run my code, when I want to check the user who is logged in (this is a web application), the method called is having an error saying The method or operation is not implemented. I need help to fix it by implementing the method. Here is where the error occurs
try
{
foreach (string caseNumber in userEnteredCaseNumberList)
{
EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
newCandidate.CaseNbr = caseNumber;
newCandidate.RequestorInfoID = Convert.ToInt32(requestorItem.Value);
newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail(); //Calls public static string GetADEmmail method
await CandidateCaseController.PostCandidate(newCandidate);
}
}
catch (Exception ex)//shows The method or operation is not implemented.
{
string errorMsg = string.Format("An error has occured in {0}. \nException:\n{1}", "GetCasesButton_Click()", ex.Message);
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + errorMsg + "');", true);
}Method that is called by line 8 with EntryStaffUserName. The error on on this method on line 7
public static string GetADEmail()
{
string retVal = string.Empty;
using (var context = new PrincipalContext(ContextType, "COURTS"))
{
UserPrincipal user = new UserPrincipal(context);
user = UserPrincipal.FindByIdentity(context, IdentityType, Environment.UserName);//this is where there is an issue. I can see UserName has a value
retVal = user.EmailAddress;
}
return retVal;
}