0

I have a url saved in the database. Now, i have another url that need to be called for login. 

the table structure as below:

id | url | createby

1 | https://getvalue.example.com | user1

Login url : https://login.example.com

Url saved in database : https://getvalue.example.com

I want to replace the 'getvalue' word with 'login'. But i dont want to update the login url in the database. The url in the database must remain as https://getvalue.example.com.

Below is my code:

public override async Task<Data> Retrieve(AdminTable admin)
{    
string login = "login";

string getvalue = "getvalue

//here should call https://login.example.com url

UriBuilder urlLog = new UriBuilder(admin.url + "/fetchData ")
using (Httpclient clientLog = new Httpclient())
{ //my process }

//here should call https://getvalue.example.com url

UriBuilder urlLog = new UriBuilder(admin.url + "/getLive ")
using (Httpclient clientLog = new Httpclient())
{ //my other process }

}

How can I do this?

ASyK
  • 13
  • 4
  • https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url – Maxim Feb 09 '22 at 03:24
  • Get the url from your table, store it in a variable and replace **getvalue** by **login**. The modification of the URL only occurs in the database if you execute SQL update or insert statements. – Rivo R. Feb 09 '22 at 03:26

0 Answers0