zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/Hotfix/Logic/Model/Module/Data/DataTableHelper.cs

41 lines
967 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using ET;
#if !SERVER
using ET;
#endif
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ET
{
public static class DataTableHelper
2021-04-24 17:39:11 +08:00
{
2021-04-08 20:09:59 +08:00
public static T Get<T>(long id) where T : class
{
2021-04-11 19:50:39 +08:00
T ret = ConfigComponent.Instance.Get<T>(id);
2021-04-08 20:09:59 +08:00
if (ret == null)
2021-04-24 17:39:11 +08:00
{
#if !UNITY
if (AppConfig.inst.isTest)
Log.Error($"{typeof (T).Name} == null where Id = {id}");
else
#endif
Log.Error($"{typeof (T).Name} == null where Id = {id}");
}
2021-04-08 20:09:59 +08:00
return ret;
}
2021-04-24 17:39:11 +08:00
2021-04-08 20:09:59 +08:00
public static T Get<T>(int id) where T : class
{
2021-04-24 17:39:11 +08:00
return Get<T>((long) id);
2021-04-08 20:09:59 +08:00
}
2021-04-24 17:39:11 +08:00
public static IEnumerable<T> GetAll<T>() where T : class
2021-04-08 20:09:59 +08:00
{
return ConfigComponent.Instance.GetAll<T>();
}
}
2021-04-24 17:39:11 +08:00
}