public async Task <CommonResponse> UpdateProfilePrivacy(string QueryUserID, UserProfilePrivacy updatedPrivacy) { var oldPrivacy = GetProfilePrivacy(QueryUserID); if (oldPrivacy != null) { var merged = TypeMerger.MergeProperties(oldPrivacy, updatedPrivacy, "Userid"); if (await _users.UpdateProfilePrivacy(merged)) { return new CommonResponse { StatusCode = 0 } } ; } return(new CommonResponse { StatusCode = -1 }); }
public CommonResponse GetProfile(string QueryUserID, string ClaimsUserID) { var user = _users.GetProfile(QueryUserID); if (user == null) { return new CommonResponse { StatusCode = -1 } } ; else { var applied = ApplyPrivacyToUserProfile(user, _users.GetProfilePrivacy(user.Userid), QueryUserID == ClaimsUserID); return(TypeMerger.MergeProperties(new GetprofileResponse { StatusCode = 0 }, applied)); } }
public async Task <CommonResponse> ModifyProfile(string UserID, UserProfile NewProfile) { var user = _users.GetProfile(UserID); if (user != null) { var merged = TypeMerger.MergeProperties(user, NewProfile, "Userid"); if (await _users.UpdateUserProfile(merged)) { return new CommonResponse { StatusCode = 0 } } ; return(new CommonResponse { StatusCode = -3 }); } return(new CommonResponse { StatusCode = -2 }); }
public PlaylistMusic ToPlaylistMusic() { return(TypeMerger.MergeProperties(new PlaylistMusic(), this) as PlaylistMusic); }
public SystemMusicLibrary ToMusicLibrary() { return(TypeMerger.MergeProperties(new SystemMusicLibrary(), this) as SystemMusicLibrary); }