/// <summary> /// 获取指定实体类型的数据上下文选项 /// </summary> public static OSharpDbContextOptions GetDbContextResolveOptions(this IUnitOfWorkManager unitOfWorkManager, Type entityType) { Type dbContextType = unitOfWorkManager.GetDbContextType(entityType); OSharpDbContextOptions dbContextOptions = unitOfWorkManager.ServiceProvider.GetOSharpOptions()?.GetDbContextOptions(dbContextType); if (dbContextOptions == null) { throw new OsharpException($"无法找到数据上下文“{dbContextType}”的配置信息"); } return(dbContextOptions); }