Created
February 1, 2013 16:06
-
-
Save msarchet/4692221 to your computer and use it in GitHub Desktop.
Ghost Doc Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Joins the chat. | |
/// </summary> | |
/// <param name="UserName">Name of the user.</param> | |
/// <param name="authguid">The authguid.</param> | |
/// <exception cref="System.Exception"> | |
/// Unable to find user | |
/// or | |
/// Unable to authorize user | |
/// </exception> | |
public void JoinChat(String UserName, String authguid) | |
{ | |
//Probably need to add the user if the user doesn't exist in the user repo at this point | |
UserModel user = userRepo.GetUserByUserName(UserName); | |
if (user == null) | |
{ | |
throw new Exception("Unable to find user"); | |
} | |
else | |
{ | |
if (user.AuthGuid != authguid || String.IsNullOrEmpty(authguid)) | |
{ | |
throw new Exception("Unable to authorize user"); | |
} | |
userConnectionRepo.AddConnectionID(UserName, Context.ConnectionId); | |
if (user.UserType == UserType.Administrator) | |
{ | |
Groups.Add(Context.ConnectionId, "Admin"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment