我有这个触发器:
CREATE TRIGGER CHECKINGMAXQTYDAYSVACANCY
ON TDINCI
AFTER INSERT
AS
DECLARE
@incidentCode int,
@dateStart datetime,
@dateEnd datetime,
@daysAccumulated int,
@maxDaysAvailable int
set @daysAccumulated = 0;
select @incidentCode = CO_INCI from inserted;
select @maxDaysAvailable = IN_DIAS_GANA from TCINCI
where CO_INCI = @incidentCode;
declare detailsCursor CURSOR FOR
select FE_INIC, FE_FINA from TDINCI
where CO_INCI = @incidentCode;
open detailsCursor;
if CURSOR_STATUS('variable', 'detailsCursor') >= 0
begin
fetch next from detailsCursor
into @dateStart, @dateEnd;
while @@FETCH_STATUS = 0
begin
set @daysAccumulated = @daysAccumulated + (DATEDIFF(DAY, @dateStart, …Run Code Online (Sandbox Code Playgroud) 我有一个类MyCustomClass:
public MyCustomClass
{
public MyCustomClass()
{
MyObject = new List<MyCustomObject>();
}
public List<MyCustomObject> MyObject {get; set;}
}
Run Code Online (Sandbox Code Playgroud)
在测试中:
List<MyCustomObject> aux = new List<MyCustomObject>();
MyCustomClass oClass = new MyCustomClass();
Assert.AreEqual(aux, oClass.MyObject)
Run Code Online (Sandbox Code Playgroud)
测试失败了,为什么?每个属性,静态成员等都是相同的.
我需要使用SpreadsheetsService,但我没有在官方文档中找到方法.net.
https://developers.google.com/google-apps/spreadsheets/?hl=ja#authorizing_requests
我的服务已通过身份验证:
String serviceAccountEmail = "serviceAccount@developer.gserviceaccount.com";
var certificate = new X509Certificate2(@"privatekey.p12", "pass", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { DriveService.Scope.Drive }
}.FromCertificate(certificate));
Run Code Online (Sandbox Code Playgroud)
从这里我可以实例化几乎任何服务.
例如Drive Service:
var service = new DriveService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "Drive API Sample",
});
Run Code Online (Sandbox Code Playgroud)
但是SpreadsheetsService我可以这样做,因为SpreadsheetsService在他的默认构造函数或其属性中的GOAuth2RequestFactory中等待字符串'application name' RequestFactory.
如何使用ServiceAccountCredential对SpreadsheetsService进行身份验证?
.net google-api google-authentication google-sheets google-spreadsheet-api
有:
初始化anonymouse集合(我会将其作为json发送)
var myCollection = new[]
{
new
{
Code = 0,
Name = "",
OtherAttribute = ""
}
}.ToList();
myCollection.Clear();
Run Code Online (Sandbox Code Playgroud)
并获取数据.
myCollection = (from iPeople in ctx.Person
join iAnotherTable in ctx.OtherTable
on iPeople.Fk equals iAnotherTable.FK
...
order by iPeople.Name ascending
select new
{
Code = iPeople.Code,
Name = iPeople.Name,
OtherAttribute = iAnotherTable.OtherAtribute
}).ToList();
Run Code Online (Sandbox Code Playgroud)
我想添加一个Identity列,我需要订购的集合,并从1计数到collection.count.用于将此计数器绑定到表(jtable)中的列.
var myCollection = new[]
{
new
{
Identity = 0,
Code = 0,
Name = "",
OtherAttribute = ""
}
}.ToList();
myCollection = (from iPeople …Run Code Online (Sandbox Code Playgroud) 我想选择一个链接some text然后我把:
$("a[text='some text']")
Run Code Online (Sandbox Code Playgroud)
但是没有用,那么我想测试从页面中选择所有链接.
$("a")
Run Code Online (Sandbox Code Playgroud)
但是这个jquery select指令只给了我页面的第一个或者最重要的链接.
为什么?
这里有一个例子:

提前致谢.
c# ×2
.net ×1
c#-to-f# ×1
cursor ×1
dom ×1
f# ×1
f#-3.0 ×1
google-api ×1
html ×1
javascript ×1
jquery ×1
linq ×1
sql ×1
sql-server ×1
t-sql ×1
unit-testing ×1