public UuidReference GetUuidReference(User userObj) { if (TryGetValue(userObj.Uuid, out UuidReference reference)) { return(reference); } var uuidRef = new UuidReference(userObj.Name) { AccountUuid = userObj.AccountUuid, UserUuid = userObj.Uuid }; SetWithIndex(userObj.Uuid, uuidRef, userObj.Name); return(Get <UuidReference>(userObj.Uuid)); }
public T GetOrCreate <T>(UuidReference reference) => GetOrCreateByUuid <T>(reference.UserUuid, reference.UserName);