我编写了一个包含以下配置的插件:

我只是想将一个datetime字段设置为等于另一个datetime字段:
IPluginExecutionContext context = localContext.PluginExecutionContext;
IOrganizationService service = localContext.OrganizationService;
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
{
// Obtain the target entity from the input parmameters.
Entity entity = (Entity)context.InputParameters["Target"];
try
{
if (entity.LogicalName == "list" && entity.Attributes["gbs_lastusedonoriginal"] != null)
{
entity.Attributes["lastusedon"] = entity.Attributes["gbs_lastusedonoriginal"];
service.Update(entity);
}
}
catch (FaultException ex)
{
throw new InvalidPluginExecutionException("An error occured in the plug-in.", ex);
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的例外是:
未处理的异常:System.ServiceModel.FaultException`1 [[Microsoft.Xrm.Sdk.OrganizationServiceFault,Microsoft.Xrm.Sdk,Version = 6.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35]]:插件中发生错误.Detail:
-2147220891 OperationStatus 0 SubErrorCode -2146233088插件中发生错误. …
c# microsoft-dynamics crm dynamics-crm-2011 dynamics-crm-2013
在尝试安装包时:
> install.packages("mlr")
Installing package into ‘/home/kisco/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependencies ‘plyr’, ‘dplyr’, ‘lazyeval’ are not available
also installing the dependencies ‘scales’, ‘ggplot2’, ‘ggvis’, ‘reshape2’
trying URL 'http://cran.rstudio.com/src/contrib/scales_0.2.5.tar.gz'
Content type 'application/x-gzip' length 56346 bytes (55 Kb)
opened URL
==================================================
downloaded 55 Kb
trying URL 'http://cran.rstudio.com/src/contrib/ggplot2_1.0.1.tar.gz'
Content type 'application/x-gzip' length 2351203 bytes (2.2 Mb)
opened URL
==================================================
downloaded 2.2 Mb
trying URL 'http://cran.rstudio.com/src/contrib/ggvis_0.4.2.tar.gz'
Content type 'application/x-gzip' length 728345 bytes (711 Kb)
opened URL
==================================================
downloaded 711 …Run Code Online (Sandbox Code Playgroud) 我有一个XrmServiceContext类,每次CRM配置更改时它都会更改。
我的服务类在其构造函数中接受它:
public class fooService(XrmServiceContext xrmServiceContext)
{
//implementation
}
Run Code Online (Sandbox Code Playgroud)
我需要模拟XrmServiceContext以便设置期望并验证单元测试的行为。
我如何模拟此类以便在我的fooService测试中定义行为?
我有一个文件,如Parent.zip与解压缩时,会产生这些文件:child1.jpg,child2.txt,child3.pdf.
运行Parent.zip下面的函数时,文件正确解压缩为:
some-container/child1.jpg
some-container/child2.txt
some-container/child3.pdf
Run Code Online (Sandbox Code Playgroud)
如何将文件解压缩到其父文件夹?期望的结果是:
some-container/Parent/child1.jpg
some-container/Parent/child2.txt
some-container/Parent/child3.pdf
Run Code Online (Sandbox Code Playgroud)
如上所示,文件夹Parent已创建.
我用它来创建blob中的文件:
using (var stream = entry.Open ()) {
//check for file or folder and update the above blob reference with actual content from stream
if (entry.Length > 0) {
await blob.UploadFromStreamAsync (stream);
}
}
Run Code Online (Sandbox Code Playgroud)
这是完整的来源:
[FunctionName ("OnUnzipHttpTriggered")]
public static async Task<IActionResult> Run (
[HttpTrigger (AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log) {
log.LogInformation ("C# …Run Code Online (Sandbox Code Playgroud) 我希望Azure函数查看SFTP文件夹,然后将新文件移动到其父文件夹。
我的脚手架看起来像这样。
public static class OnMoveFilesHttpTriggered
{
[FunctionName("OnMoveFilesHttpTriggered")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
}
}
Run Code Online (Sandbox Code Playgroud)
我们如何强制在任何给定时间运行此函数的一个且只有一个实例?
我们如何减去两个字典,得到具有差异的第三个字典?
我有一本字典Dictionary<string, int>():
+-------+----+
| alex | 10 |
| liza | 10 |
| harry | 20 |
+-------+----+
Run Code Online (Sandbox Code Playgroud)
从这个字典中,我想减去这个字典:
+-------+---+
| alex | 5 |
| liza | 4 |
| harry | 1 |
+-------+---+
Run Code Online (Sandbox Code Playgroud)
我正在寻找的结果是:
+-------+----+
| alex | 5 |
| liza | 6 |
| harry | 19 |
+-------+----+
Run Code Online (Sandbox Code Playgroud)
我们如何减去两个字典,得到具有差异的第三个字典?
我有一堆文本文件,需要将它们连接成 1 个字符串:
最终结果是内容的串联20211026_113900.sql + 20211027_083900.sql + 20211027_093900.sql
我们如何连接文件的内容以确保按字母顺序排列?
20211026_113900.sql
从 mytable1 中选择名称 GO
20211027_083900.sql
从 mytable2 GO 中选择名称
20211027_093900.sql
从 mytable3 GO 中选择名称
我期待的最终结果是:
从 mytable1 中选择名称 GO 从 mytable2 中选择名称 GO 从 mytable3 中选择名称 GO
我正在尝试安装以下 nuget 包:
install-package microsoft.entityframeworkcore.sqlserver
但是我遇到了这个异常:
Restoring packages for C:\Users\alex.ggg\source\repos\ccp\ccp.Rag\ccp.Rag.csproj...
install-package : NU1202: Package Microsoft.EntityFrameworkCore.SqlServer 6.0.0 is not
compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package
Microsoft.EntityFrameworkCore.SqlServer 6.0.0 supports: net6.0 (.NETCoreApp,Version=v6.0)
At line:1 char:1
+ install-package microsoft.entityframeworkcore.sqlserver -ProjectName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.Powe
rShellCmdlets.InstallPackageCommand
install-package : Package restore failed. Rolling back package changes for 'ccp.Rag'.
At line:1 char:1
+ install-package microsoft.entityframeworkcore.sqlserver -ProjectName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId …Run Code Online (Sandbox Code Playgroud) c# ×6
.net ×3
azure ×2
crm ×1
dictionary ×1
dynamics-crm ×1
installation ×1
javascript ×1
jquery ×1
moq ×1
nunit ×1
package ×1
powershell ×1
r ×1
unit-testing ×1
vb.net ×1