I am having a trouble in C# with a very simple method.

the method is supposed to return a boolean value (true or false). Here is the code.

I get compilation error saying that "not all code paths return a value":

public static bool IsMember(List<string> ADGroups)

{

System.Security.Principal.IPrincipal User1;
User1 = System.Web.HttpContext.Current.User;
//check to see if the user trying to access the website is a member of the list of the ActiveDirectory groups that was passed.

foreach (string xx in ADGroups)

{
string sADRole = "fhlbsf-i.com\\"+ xx.ToString();
if ((User1.IsInRole(sADRole) == true))

{

return true;
}
else

{

return false;

}
}