/// <summary>
 ///     Returns the instance of this class associated with this user and community.
 /// </summary>
 /// <param name="account"></param>
 /// <param name="communityId"></param>
 /// <returns></returns>
 public static MetadataManager GetInstance(Account account, string communityId = null)
 {
     if (account == null)
     {
         account = AccountManager.GetAccount();
     }
     if (account == null)
     {
         return null;
     }
     string uniqueId = Constants.GenerateAccountCommunityId(account, communityId);
     lock (Synclock)
     {
         MetadataManager instance = null;
         if (_instances != null)
         {
             if (_instances.TryGetValue(uniqueId, out instance))
             {
                 return instance;
             }
             instance = new MetadataManager(account, communityId);
             _instances.Add(uniqueId, instance);
         }
         else
         {
             _instances = new Dictionary<string, MetadataManager>();
             instance = new MetadataManager(account, communityId);
             _instances.Add(uniqueId, instance);
         }
         return instance;
     }
 }