Пример #1
0
 /// <summary>
 /// Map an IdentityUserClaim to the DataObject UserClaim for saving.
 /// </summary>
 /// <returns></returns>
 public UserClaim MapToUserClaim()
 {
     var userClaim = new UserClaim();
     userClaim.Id = Id.IsNull() ? Guid.NewGuid() : Id.ToGuid();
     userClaim.UserId = UserId.ToGuid();
     userClaim.ClaimType = ClaimType;
     userClaim.ClaimValue = ClaimValue;
     return userClaim;
 }
Пример #2
0
 /// <summary>
 /// Map an IdentityUserClaim from the DataObject UserClaim.
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public static IdentityUserClaim MapFromUserClaim(UserClaim userClaim)
 {
     if (userClaim != null) {
         var claim = new IdentityUserClaim();
         claim.Id = userClaim.Id.ToString();
         claim.UserId = userClaim.UserId.ToString();
         claim.ClaimType = userClaim.ClaimType;
         claim.ClaimValue = userClaim.ClaimValue;
         return claim;
     } else {
         return null;
     }
 }