예제 #1
0
		public async Task GetProfile( TokenViewModel Token )
		{
			try
			{
				var User = await this.VerifyToken( Token );
				if ( User != null )
				{
					//Return Profile that belongs to User
					var profile = new ProfileViewModel(User.Profile);
					Clients.Caller.Profile(profile);
				}
				else
				{
					Clients.Caller.error( "Unauthorized Access." );
				}
			}
			catch ( Exception error )
			{
				Clients.Caller.error( "Exception Occurred: " + error.Message );
			}
		}
예제 #2
0
 /// <summary>
 /// Allows changes to be made to a profile using a ViewModel. This is a form of white-listing and seperatation.
 /// </summary>
 /// <param name="Profile">The View Model to use to change the loaded Profile.</param>
 public void UpdateProfile(ProfileViewModel Profile)
 {
     this.DefaultColor = Profile.DefaultColor;
 }