private static string GetTableName(Type type) { //检测类型是否为泛型 if (type.GetType().IsGenericType) {//取出泛型类型 var types = type.GetGenericArguments(); type = types.FirstOrDefault(); } var name = type.GetAttribute<TableNameAttribute>()?.Name; if (string.IsN…