我们有一位先生不再积极参与某个项目。问题是他是我们 Pull Request 中必需的审阅者。
我无法找到删除他的方法,我们也无法完成我们的拉取请求。
我花了几个小时研究我能找到的每一个选项。
10/10 更新——我们尝试使用 API 并删除该审阅者并进行另一次 PR,但还没有成功。我们甚至尝试过让其他审阅者批准,但如果没有其他必需的审阅者,我们就无法完成。我很乐意转移这个问题,因为我知道它与代码无关,但不知道去哪里......这不仅仅是一个“你认为最好的工具”的问题——我们真的处于困境中这里有一个绑定!
我使用xmlDocument方法完成了以下多次,但我想使用更强大的linq到xml方法.但是,我似乎碰壁了.我从twillio/crmText的restful API中获取数据.以下是他们的网站所在网站的链接:http: //crmtext.com/api/docs
这是我的XML字符串:
<response op="getcustomerinfo" status="200" message="ok" version="1.0">
<customer>
<totalMsg>3</totalMsg>
<custId>9008281</custId>
<custName></custName>
<timestamp>2015-04-30 16:17:19</timestamp>
<optinStatus>3</optinStatus>
<custMobile>6185551212</custMobile>
<subacct>1st Choice Courier</subacct>
</customer>
</response>
Run Code Online (Sandbox Code Playgroud)
我需要找出optinStatus.它应该返回3.我使用下面的,返回上面的xml
XDocument xdoc = XDocument.Parse(result1);
Run Code Online (Sandbox Code Playgroud)
我尝试了大约4000种不同的东西,包括:
IEnumerable<XElement> otinStatus = from el in xdoc.Elements("customer") select el;
IEnumerable<XElement> otinStatus2 = from el in xdoc.Elements("cusotmer.optinStatus") select el;
IEnumerable<XElement> otinStatus3 = from el in xdoc.Elements("optinStatus") select el;
Run Code Online (Sandbox Code Playgroud)
所有这些都不会返回任何结果.
请帮助,我知道这是我想念的简单事.提前谢谢你 - 乔
这是我无法相信我无法弄清楚的事情 - 请告诉我,我错过了一些简单的事情......
我有一个datagrid,我用LINQ填充它以及一个自定义类来向它添加数据.
之后,我需要按特定顺序的数据 - 它似乎忽略了我.
如何更改列属性,如索引等?
这是我正在使用的LINQ代码:
提前致谢...
Dim query = From m In db.details _
Where m.InboundDate >= CType(MonthCalendar1.SelectionStart, DateTime) _
And m.InboundDate <= CType(MonthCalendar1.SelectionEnd, DateTime).AddHours(23).AddMinutes(59) _
And m.ClientNo = 1 _
Join md In db.Manifests On md.ManifestID Equals m.MainID _
Select New GridData With {.manifestID = m.MainID, .InboundDate = m.InboundDate, .Zip = m.Zip, .LadingPkgQty = md.LadingPkgQty, .Weight = m.Weight, .Zone = m.Zone, .Fuel = 23, .LineHaul = Nothing, .Freight = Nothing, .BilledAmount = Nothing, .PackageRate = …Run Code Online (Sandbox Code Playgroud) 我已经搜索了一段时间,但没有找到任何东西.
我正在存储一些非常长的SQL选择字符串(像这样的较短的一个:)
string mySelectQuery = "select distribution_stop_information.unique_id_no as stop_unique_id_no,distribution_line_items.unique_id_no as line_unique_id_no, stop_name, stop_address,route_code AS RouteCode, customer_reference," +
"distribution_line_items.datetime_created, rma_number from distribution_stop_information join distribution_line_items on " +
"distribution_line_items.unique_id_no = distribution_stop_information.unique_id_no " +
"where distribution_line_items.datetime_created > '2/22/2017' and customer_no = '91000'";
Run Code Online (Sandbox Code Playgroud)
然后传递给他们
var Ourstops = (List<stop_data>)db.Query<stop_data>(mySelectQuery);
Run Code Online (Sandbox Code Playgroud)
这很麻烦,并且难以读取/调试代码.
有什么更好的方法呢?
只是一个苛刻的点 - 在这个项目上我不允许创建任何sprocs.严格来说,查询只使用类型,并使用postgresql(不是那里那么重要)
我为此苦苦挣扎多年,通常只是按照我的方式编写代码,但是现在是解决它的时候了。
我声明一个返回新的匿名类型的变量,并将其放在try / catch中。但是,这样做意味着它不在范围内,以后的代码显然看不到。通常我只是先声明它,然后将代码包装在try / catch中,然后像下面这样在其中重新分配:
int result = 0;
try
{
result = 77; //real code goes here
}
catch (Exception)
{
throw;
}
Run Code Online (Sandbox Code Playgroud)
但是这是我的真实代码,我无法弄清楚该如何做:
try
{
var dt_stop = (from s in cDb.DistributionStopInformations
join r in cDb.DistributionRouteHeaders on s.RouteCode equals r.RouteCode
where r.RouteDate == s.RouteDate &&
r.BranchId == s.BranchId &&
(r.CompanyNo == companyNo && s.CompanyNo == companyNo)
&& s.UniqueIdNo == uniqueId
select new
{
s,
r
}).Single();
}
catch (Exception)
{ //no this will not be blank
throw; …Run Code Online (Sandbox Code Playgroud) 我已经尝试了几个小时来解决这个问题,但我不断收到错误消息:[致命] 生成客户端模型时出错:找到具有重复 operationId 'recent_items' 的操作对象。OperationId 在 API 中描述的所有操作中必须是唯一的。
我正在使用 Visual Studio 2017 Azure SQL 数据库 C#
我在下面看不到任何重复的操作 ID(我似乎也无法在这里整齐地格式化它 - 非常抱歉!)
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "azure_items_API"
},
"host": "azureitemsapi20170719125618.azurewebsites.net",
"schemes": ["http"],
"paths": {
"/api/recent_items": {
"get": {
"tags": ["recent_items"],
"operationId": "recent_items_GetAllrecent_items",
"consumes": [],
"produces": ["application/json",
"text/json",
"application/xml",
"text/xml"],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/recent_items"
}
}
}
},
"deprecated": false
},
"post": {
"tags": ["recent_items"],
"operationId": "recent_items_Postrecent_items",
"consumes": ["application/json", …Run Code Online (Sandbox Code Playgroud) 我认为对于Azure函数来说,这将是一个完美的入门测试用例。
我们在Azure(SQL数据库)中有一个SQL存储。
使用C#,VS 2017更新了Azure工作流项目。
我们也有一个Blob存储。每天晚上,我都需要一个过程来访问SQL数据库,根据条件收集一组记录,然后对其进行处理以生成将存储在Blob存储中的文件。
我似乎无法克服完成这些任务中的任何一个的困难。所有的教程似乎都是最基本的类型。
我在VS 2017中创建了一个函数,但第一步只是连接到SQL数据库。
我去添加一个新项目:ADO.NET实体数据模型,它的行为就像它正确创建了模型一样,但是没有数据上下文吗?
因此,我决定尝试下一步-创建Blob,然后仅使用经过硬编码的示例数据。再次...找不到有关如何执行此操作的良好指南。
我在local.setting.json文件中有一个“ AzureWebJobsStorage”设置。
我在下面有一个计时器功能:
public static class Function1
{
[FunctionName("Function1")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
}
Run Code Online (Sandbox Code Playgroud)
只是有些人朝着正确的方向指点,我会不断努力奋斗...
乔
我已经阅读了有关Stack Overflow的几篇文章和问题,但仍然看不出我做错了什么.不使用C#6 - 抱歉一开始没有发布.VS 2013.
此代码有效:
if (row.Cells["CSR_Notes"].Value != null)
{
deliveryEvent.CSR_Notes = row.Cells["CSR_Notes"].Value.ToString();
}
Run Code Online (Sandbox Code Playgroud)
这段代码有效:
deliveryEvent.CSR_Notes = row.Cells["CSR_Notes"].Value != null
? row.Cells["CSR_Notes"].Value.ToString() : "";
Run Code Online (Sandbox Code Playgroud)
但是如果值为null,则此代码会抛出"Object reference not set ..."错误.
deliveryEvent.CSR_Notes = row.Cells["CSR_Notes"].Value.ToString() ?? "";
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
简单的请求 - 有没有人知道将这一点合并到一行的方法: 编辑 - 我对前后增量运算符并不感到困惑.我发布的问题应该有效,老实说我不知道发生了什么.介于VS和SO之间我修复了它.
startingMask++;
string mask2 = startingMask.ToString().PadLeft(3, '0');
Run Code Online (Sandbox Code Playgroud)
就像是
string mask2 = (startingMask++).ToString().PadLeft(3, '0');
Run Code Online (Sandbox Code Playgroud)
编辑 - 好吧 - 放松 - :)
这是最后的完整解决方案,我应该在第一个问题中提供更多信息,我只是想在正确的方向上轻推(需要的数量和起始数量将在某个时候通过数据库拉动改变):
int startingMask = 76;
int numberNumberNeeded = 10;
List<string> masks = new List<string>();
while (numberNumberNeeded > 0)
{
string newMask = (startingMask++).ToString().PadLeft(3, '0');
masks.Add(newMask);
numberNumberNeeded--;
}
Run Code Online (Sandbox Code Playgroud) c# ×7
azure ×2
linq ×2
asp.net-mvc ×1
azure-devops ×1
azure-repos ×1
datagridview ×1
rest ×1
sql ×1
string ×1
swagger-2.0 ×1
vb.net ×1
xml ×1