Swagger显示来自其他项目的端点

时间:2019-09-30 14:52:30

标签: asp.net-core asp.net-web-api swagger

我有几个项目的解决方案。 他们中很少有人使用Web Api。 在那里,我使用Swagger。

在一个项目(项目A)中,我只有一个端点。 但是当我启动Swagger时,我还看到了另一个项目(项目B)的端点。 相反,我在(B)项目的Swagger中看不到一个端点(A)。

两个项目的Swagger配置相似。

Option Explicit

Sub SearchAndBuild()

    Dim rSearch As Range
    Dim lDayOne As Long, lDayTwo As Long
    Dim lColOne As Long, lColTwo As Long
    Dim sHello As String
    Dim wsS1 As Worksheet
    Dim i As Long


    'set the worksheet object
    Set wsS1 = ThisWorkbook.Sheets("Sheet1")
    'store variables
    lDayOne = Day(wsS1.Range("A1").Value)
    lDayTwo = Day(wsS1.Range("B1").Value)
    sHello = wsS1.Range("C1").Value

    'find the student first
    Set rSearch = wsS1.Range("A:A").Find(What:="Student", LookAt:=xlWhole)

    'error handling
    If rSearch Is Nothing Then
        MsgBox "Error, could not find Student."
        Exit Sub
    End If

    'now loop forwards to find first date and second date - store column naumbers
    'adjust these limits where necessary - can make dynamic
    For i = 4 To 13
        If wsS1.Cells(2, i).Value = lDayOne Then
            lColOne = i
        End If
        If wsS1.Cells(2, i).Value = lDayTwo Then
            lColTwo = i
            Exit For
        End If
    Next i

    'now merge the range
    wsS1.Range(wsS1.Cells(rSearch.Row, lColOne), wsS1.Cells(rSearch.Row, lColTwo)).Merge

    'set the vvalue
    wsS1.Cells(rSearch.Row, lColOne).Value = sHello

End Sub

怎么可能? 我需要更改以仅获得自己的端点吗?

1 个答案:

答案 0 :(得分:1)

解决方案是项目A使用项目B中的类。该类必须位于公共业务项目中。所以我删除了类和依赖项。现在一切正常。