Example #1
0
        public void DeleteBy(Predicate <TEntity> match)
        {
            if (TryFindBy(match, out TEntity e))
            {
                EntityList.Remove(e);
                return;
            }

            ExDebug.LogWarning("Not found Entity");
        }
Example #2
0
        /// <summary>
        /// Load from local. and initialize database instace.
        /// </summary>
        /// <param name="database"></param>
        /// <param name="filePath"></param>
        public static void Load(this IDatabase database, string filePath)
        {
            if (string.IsNullOrEmpty(filePath))
            {
                ExDebug.LogWarning($"File path is null or empty. Database name is {database.KName}");
                return;
            }

            database.FromJson(ExIO.ReadAllText(filePath));
        }
Example #3
0
        public void LogAllEntity()
        {
            if (IsNullOrEmpty())
            {
                ExDebug.LogWarning($"{KName} data is null or empty.");
                return;
            }

            foreach (var entity in FindAll())
            {
                ExDebug.Log(entity.ToString());
            }
        }