public ConfigT GetConfig <ConfigT>(int dataName, int groupName, string configName, int id) where ConfigT : IConfig, new() { ConfigData data = Datas.GetData <ConfigData>(dataName); ConfigsResult configs = data.GetConfigs(groupName); Dictionary <int, ConfigT> mapper = configs.GetConfigRaw <ConfigT>(configName, out int statu); return(statu == 0 ? mapper[id] : default);
public Dictionary <int, ConfigT> GetConfig <ConfigT>(int dataName, int groupName, string configName, out int statu) where ConfigT : IConfig, new() { ConfigData data = Datas.GetData <ConfigData>(dataName); ConfigsResult configs = data.GetConfigs(groupName); Dictionary <int, ConfigT> dic = configs.GetConfigRaw <ConfigT>(configName, out statu); return(dic); }
private void HandleRequestData(ConfigsResult item, List <SysConfigs> list) { if (item == null) { return; } var mapConfig = new MapperConfiguration(cfg => { cfg.CreateMap <string, int?>().ConvertUsing(new NullableIntUtcTimeTypeConverter()); cfg.CreateMap <string, DateTime?>().ConvertUsing(new NullableUtcTimeTypeConverter()); cfg.CreateMap <ConfigsResult, SysConfigs>(); }); //mapConfig.AssertConfigurationIsValid(); var result = item.MapTo <ConfigsResult, SysConfigs>(mapConfig); list.Add(result); }
public void InitGroupConfigs(int dataName, int groupName, ref ConfigsResult result) { ConfigData data = Datas.GetData <ConfigData>(dataName); data.AddConfigs(groupName, result); }