protected virtual void UpdateLinkedAccount(LinkedAccount account, IEnumerable<Claim> claims = null) { if (account == null) { throw new ArgumentNullException("account"); } account.LastLogin = DateTime.Now; account.UpdateClaims(claims); }
public virtual void AddOrUpdateLinkedAccount(string provider, string id, IEnumerable<Claim> claims = null) { if (String.IsNullOrWhiteSpace(provider)) { throw new ArgumentNullException("provider"); } if (String.IsNullOrWhiteSpace(id)) { throw new ArgumentNullException("id"); } var linked = GetLinkedAccount(provider, id); if (linked == null) { linked = new LinkedAccount { ProviderName = provider, ProviderAccountID = id }; this.LinkedAccounts.Add(linked); } UpdateLinkedAccount(linked, claims); }