Back to Devexpress

WebApiDataStoreClient.GetConnectionString(String) Method

xpo-devexpress-dot-xpo-dot-db-dot-webapidatastoreclient-dot-getconnectionstring-x28-system-dot-string-x29.md

latest2.2 KB
Original Source

WebApiDataStoreClient.GetConnectionString(String) Method

Returns a connection string that can be passed to the XpoDefault.GetDataLayer and XpoDefault.GetConnectionProvider methods.

Namespace : DevExpress.Xpo.DB

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public static string GetConnectionString(
    string url
)
vb
Public Shared Function GetConnectionString(
    url As String
) As String

Parameters

NameTypeDescription
urlString

A web service address that includes the controller name.

|

Returns

TypeDescription
String

A string that contains the connection string for a WebApiDataStoreClient instance.

|

Remarks

WebApiDataStoreClient uses the System.Net.Http.HttpClient) component. To operate correctly, HttpClient.BaseAddress should point to a controller route.

HttpClient merges BaseAddress with a relative URI according to section 5.2.3. Merge Paths. This means that HttpClient excludes the last segment of the BaseAddress. To prevent this, add a slash (/) to the end of the BaseAddress.

See Also

WebApiDataStoreClient Class

WebApiDataStoreClient Members

DevExpress.Xpo.DB Namespace