update custom database

This commit is contained in:
sunkaixuna 2022-02-02 00:05:00 +08:00
parent 613eb5275b
commit 88a4ecee06
2 changed files with 10 additions and 5 deletions

View File

@ -125,10 +125,6 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SqlSugar.MySqlConnector\SqlSugar.MySqlConnector.csproj">
<Project>{d131ee06-bad4-4b80-b7de-d6f539087644}</Project>
<Name>SqlSugar.MySqlConnector</Name>
</ProjectReference>
<ProjectReference Include="..\SqlSugar\SqlSugar.csproj">
<Project>{489bb790-226c-4fad-8d1e-51d72a7ff8e5}</Project>
<Name>SqlSugar</Name>

View File

@ -497,7 +497,16 @@ namespace SqlSugar
{
var key = "Assembly_"+ CustomTypeName+assembly.GetHashCode();
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
return Assembly.LoadFrom(CustomTypeName + ".dll");
try
{
return Assembly.LoadFrom(CustomTypeName + ".dll");
}
catch
{
var message = "Not Found " + CustomTypeName + ".dll";
Check.Exception(true, message);
return null;
}
});
Type type = newAssembly.GetType(className);
return type;