我有一个解决方案UI项目和另一个Web api解决方案项目。在Web api中我有一个图像文件夹。我想在UI项目中获取该路径。
公共IActionResult Index() {
string imgUrl = "F:\\NARESHPANDIT\\IDENTICA-TFS\\Minha Pousada\\Management micro-service\\Minha-Pousada.WebApi\\wwwroot\\BProfileFile";
BusinessProfileModel model = new BusinessProfileModel();
string contents = JsonConvert.SerializeObject(model);
List<BusinessProfileModel> businesslist = new List<BusinessProfileModel>();
using (HttpResponseMessage response = objAPI.CallAPI("/BusinessProfile/GetBusinessProfile", contents))
{
if (response.IsSuccessStatusCode)
{
string responseString = response.Content.ReadAsStringAsync().Result;
if (!string.IsNullOrEmpty(responseString))
{
businesslist = JsonConvert.DeserializeObject<List<BusinessProfileModel>>(responseString);
}
}
}
model.Imgurl = imgUrl;
model.BusinessProfileList = businesslist;
return View(model);
}