如何在ASP.NET Core 2.2 Web应用程序中访问文件夹图像路径

时间:2019-05-15 05:25:37

标签: ef-code-first asp.net-core-2.2

我有一个解决方案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);
    }

0 个答案:

没有答案