我已经使用VS 2015很长一段时间了,最近刚搬到2017年.我的cshtml文本都是一种颜色(黑色),我一直试图弄清楚为什么它们不像我的其他文件类型那样突出显示.有任何想法吗?这非常令人沮丧,因为我已经通过不同的设置和许多帖子寻找答案.我肯定错过了什么.
我使用composer在Cloud9工作区上安装了一个Yii2"基本"应用程序.它运行正常,你可以在这里看到https://portfolio-php--dfmmalaw.c9.io/basic/web/index.php
问题是我在部署到Heroku URL后尝试查看时遇到以下错误.
"禁止您无权访问/在此服务器上."
下面的截图是我的Cloud9工作区 http://prntscr.com/8rrkn0
我甚至尝试将基本/ web/index.php添加到Heroku URL,但我只是得到一个空白页面.我究竟做错了什么?
我的第一个开发角色已经 6 个月了,并开始在我们的存储库层中使用更多 LINQ 来查询我们的数据库。我确实可以为我创建的两个查询提供一些帮助。
IQueryable<long> clientsWithoutFeature = from cf in db.Features
where cf.Feature != 9 && cf.Feature == 8
select cf.Client;
IQueryable<long> clientsWithFeature = from cf in db.Features
where cf.Feature == 9 && cf.Feature == 8
select cf.Client;
Run Code Online (Sandbox Code Playgroud)
每个客户端可以有多个功能,每个功能都是一个单独的记录/行。
第一个查询应该返回特征为 8 但不是特征为 9 的所有客户端。但是,它会返回特征为 8 的所有客户端,无论客户端是否也具有特征 9。
第二个查询应该返回特征为 8 且特征为 9 的所有客户端。但是,它不会返回任何客户端。
有人可以告诉我我的查询有什么问题吗?
我试图从同步方法调用异步方法,它继续轰炸调用GetUsTraceApiHealth()但没有错误.问题是什么?
通话方式:
public ActionResult TestSSN()
{
try
{
var apiResponse = GetUsTraceApiHealth().GetAwaiter().GetResult();
string responseBody = apiResponse.Content.ReadAsStringAsync().Result;
return Json(responseBody, JsonRequestBehavior.AllowGet);
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}
Run Code Online (Sandbox Code Playgroud)
被调用的方法:
public async Task<HttpResponseMessage> GetUsTraceApiHealth()
{
using (HttpClient httpClient = new HttpClient())
{
try
{
string uri = $"https://trace.{ConfigHelper.SterlingDomain}health?deep";
HttpResponseMessage apiResponse = await httpClient.GetAsync(uri);
return apiResponse;
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}
}
Run Code Online (Sandbox Code Playgroud)