Esempio n. 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (CultureId == null ? 0 : CultureId.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (Name == null ? 0 : Name.GetHashCode());
         return(hash);
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (CultureId == null ? 0 : CultureId.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (ProductDescriptionId == default(int) ? 0 : ProductDescriptionId.GetHashCode());
         hash = hash * 23 + (ProductModelId == default(int) ? 0 : ProductModelId.GetHashCode());
         return(hash);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Serves as a hash function for a <see cref="Faction"/> object.
 /// </summary>
 /// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         return(((Id != null ? Id.GetHashCode() : 0) * 397) ^
                (Name != null ? Name.GetHashCode() : 0) ^
                (Description != null ? Description.GetHashCode() : 0) ^
                (FlagId != null ? FlagId.GetHashCode() : 0) ^
                (CultureId != null ? CultureId.GetHashCode() : 0) ^
                Colour.GetHashCode() ^
                Wealth.GetHashCode() ^
                Alive.GetHashCode());
     }
 }
        public async Task <ClaimsIdentity> GenerateUserIdentityAsync(UserManager <ApplicationUser> manager)
        {
            // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
            var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);

            // Add custom user claims here
            userIdentity.AddClaim(new Claim("HouseholdId", HouseholdId.ToString()));
            userIdentity.AddClaim(new Claim("FullName", FullName));
            userIdentity.AddClaim(new Claim("NegFormatId", NegFormatId.ToString()));
            userIdentity.AddClaim(new Claim("CultureId", CultureId.ToString()));
            foreach (var account in BankAccounts)
            {
                userIdentity.AddClaim(new Claim("BankAccount", account.Id.ToString()));
            }
            return(userIdentity);
        }
Esempio n. 5
0
 public override string GetCacheKey()
 {
     return(string.Format("TranslationValCriteria_{0}",
                          CultureId == null ? "null" : CultureId.GetCacheKey(),
                          Key == null ? "null" : Key.GetCacheKey()));
 }
Esempio n. 6
0
 public override string GetCacheKey()
 {
     return(string.Format("TranslationValKey_{0}_{1}", CultureId.ToString(), Key));
 }