41 lines
967 B
C#
41 lines
967 B
C#
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
|
|
{
|
|
public static T Get<T>(long id) where T : class
|
|
{
|
|
T ret = ConfigComponent.Instance.Get<T>(id);
|
|
if (ret == null)
|
|
{
|
|
#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}");
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
public static T Get<T>(int id) where T : class
|
|
{
|
|
return Get<T>((long) id);
|
|
}
|
|
|
|
public static IEnumerable<T> GetAll<T>() where T : class
|
|
{
|
|
return ConfigComponent.Instance.GetAll<T>();
|
|
}
|
|
}
|
|
} |