I am trying to get the endpointURL. To get those endpointURL, I have to use system.servicemodel.configuration nuget package. However, in .net CORE I am not able to find those package. I am getting error in the below code
public static string GetEndPointUrl(string contractName)
{
var address = string.Empty;
var serviceModel = (ClientSection)ConfigurationManager.GetSection("system.serviceModel/client");
var endPoint = serviceModel.Endpoints.Cast<ChannelEndpointElement>().SingleOrDefault(x => x.Contract == contractName);
if (endPoint != null)
address = endPoint.Address.AbsoluteUri.ToString();
return address;
}
I am getting error in clientSection and ChannelEndpointElement which is the part of system.servicemodel. I dont know what is the alternative of this.