public ISqlSugarProvider GetByName(string name, string defaultName) { ISqlSugarProvider result = null; if (name == null) { if (!DataMap.TryGetValue(defaultName, out result)) { throw new Exception("没有找到 DefaultName Provider"); } return(result); } else if (DataMap.TryGetValue(name, out result)) { return(result); } throw new ArgumentException($"没有找到 {name} Provider"); }
public void AddOrUpdate(string name, ISqlSugarProvider val) { DataMap[name] = val; }