EF Core 中 .WillCascadeOnDelete(false) 的等价物是什么?
modelBuilder.Entity<ProductTransactionHistoryClassImport>()
.HasMany(e => e.ProductTransactionHistoryClassDetailImports)
.WithOne(e => e.ProductTransactionHistoryClassImport)
.WillCascadeOnDelete(false);
Run Code Online (Sandbox Code Playgroud) 我刚刚安装了VS2013和Resharper.我试图从Options|Environment|Fonts and Colors菜单中更改特定类型的项目(如枚举和代理)的颜色.但是,当我尝试更改Resharper自己的项目(例如"Resharper Enum Identifier")时,它们不起作用.更改它们不会更改编辑器中的颜色.但是,我注意到一些Resharpers项目确实有效(例如,"Resharper Todo Item"有效,但我尝试的其他任何东西都没有).
有人知道是什么原因引起的吗?我试图删除HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors\Cache注册表,但这并没有解决这个问题.
如何在Thinktecture IdentityServer v3中启用日志记录?
我目前正在收到一个通用的错误页面,说"出现意外错误".
我能够弄清楚通常的错误会被返回,ErrorPageFilterAttribute这似乎解决了一些ILog记录我所追求的细节的实现.
我怀疑它是一些具体的实现ILog需要以某种方式配置.
我正在使用VS 2015,我想用.NET Framework 4.5和SQLite开发Win Form应用程序.
我已经安装了最后一个带有所有依赖项的"System.Data.SQLite"nuget包到我的项目中,但是当我尝试添加新连接来管理我的数据库时,我找不到SQLite数据提供程序.
我从这里尝试VS 2013的解决方案,但不起作用.
VS 2015还没有捆绑,这是问题吗?是2015年使用2013捆绑包或其他解决方案的任何解决方案?
我有非常基本的路由:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",parameters
new { controller = "Home", action = "Index", id = "" }
);
Run Code Online (Sandbox Code Playgroud)
问题是它在所有简单的情况下都能很好地工作,例如www.xxx.yy/pages/filter/test".一旦我添加点"."到{id}部分它失败了,返回'无法找到资源'.它发生了www.xxx.yy/pages/filter/test.
有什么建议?
尝试使用Thinctecture identityserver v3作为多个mvc应用程序的简单sts.
我能够遍历所提供的示例应用程序并且运行正常,但它们都使用嵌入式身份服务器.我需要将identityserver作为一个单独的应用程序,以便我可以将它用作多个应用程序的sts.当我尝试运行身份服务器并将示例mvc应用程序连接到它时似乎缺少某些东西.
示例mvc应用程序使用武士刀
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions...
Run Code Online (Sandbox Code Playgroud)
但我只是不明白如何正确配置外部应用服务.我的猜测是我没有使用正确的端点.
这是我的依赖方配置为mvc.然后我在这里运行了最新的IS v3 :: 44333
在mvc应用程序中,每当我尝试导航到需要授权的视图时,我都会得到异常.
堆栈跟踪:
[HttpRequestException: Response status code does not indicate success: 404 (Not Found).]
System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() +87960
Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__0.MoveNext() +496
[IOException: Unable to get document from: https://localhost:44333/.well-known/openid-configuration]
Microsoft.IdentityModel.Protocols.<GetDocumentAsync>d__0.MoveNext() +830
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24
Microsoft.IdentityModel.Protocols.<GetAsync>d__0.MoveNext() +512
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24
Microsoft.IdentityModel.Protocols.<GetConfigurationAsync>d__3.MoveNext() +1332
Run Code Online (Sandbox Code Playgroud)
这是mvc应用程序中的完整身份验证配置.
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
//Authority = "https://localhost:44319/identity",
Authority = "https://localhost:44333",
ClientId = "mvc",
Scope = "openid profile roles",
RedirectUri = "https://localhost:44319/",
SignInAsAuthenticationType …Run Code Online (Sandbox Code Playgroud) 我们使用iText5.5版PdfCopy合并多个标记的PDF.(那些标记的PDF不是由iText.创建的.)我们在以下情况下遇到以下错误document.close:
java.lang.NullPointerException
at com.itextpdf.text.pdf.RefKey.<init>(RefKey.java:59)
at com.itextpdf.text.pdf.PdfCopy.fixTaggedStructure(PdfCopy.java:822)
at com.itextpdf.text.pdf.PdfCopy.flushTaggedObjects(PdfCopy.java:779)
at com.itextpdf.text.pdf.PdfDocument.close(PdfDocument.java:854)
at com.itextpdf.text.Document.close(Document.java:416)
com.itextpdf.text.exceptions.InvalidPdfException: Rebuild failed: trailer not found.; Original message: PDF startxref not found.
at com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:668)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:181)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:230)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:207)
at com.itextpdf.text.pdf.PdfReader.<init>(PdfReader.java:197)
Run Code Online (Sandbox Code Playgroud)
PDF有效且包含预告片%EOF,文件未损坏.还有什么可能导致这个?
我有四个文件:
one_file.txt
abc | def
Run Code Online (Sandbox Code Playgroud)
two_file.txt
ghi | jkl
Run Code Online (Sandbox Code Playgroud)
three_file.txt
mno | pqr
Run Code Online (Sandbox Code Playgroud)
four_WORD.txt
xyz| xyz
Run Code Online (Sandbox Code Playgroud)
我想连接所有以"file.txt"结尾的文件(即除了four_WORD.txt之外的所有文件)以获得:
abc | def
ghi | jkl
mno | pqr
Run Code Online (Sandbox Code Playgroud)
为此,我运行:
cat*file.txt> full_set.txt
但是,full_set.txt表示为:
abc | defmno | pqrghi | jkl
Run Code Online (Sandbox Code Playgroud)
任何想法如何正确有效地做到这一点,以便每个人最终都在自己的路线上?实际上,我需要对很多非常大的文件执行上述操作.预先感谢您的帮助.
我正在尝试遵循简单的指南mvcGettingStarted.现在,我已经实现了两者GoogleAuthentication和FacebookAuthentication提供者,一切都按预期工作,我实际上可以登录,如果我使用我的身份服务器登录,我还获得了每个用户的角色声明.我想知道,如果我想保留外部提供商提供的所有索赔怎么办?简单的例子.这就是我的Facebook提供商设置的样子:
var facebookOptions = new FacebookAuthenticationOptions() {
AuthenticationType = "Facebook",
Caption = "Sign in with Facebook",
AppId = "*****",
AppSecret = "****",
SignInAsAuthenticationType = signInAsType,
Provider = new FacebookAuthenticationProvider() {
OnAuthenticated = (context) => {
foreach (var x in context.User) {
context.Identity.AddClaim(new Claim(x.Key, x.Value.ToString()));
}
return Task.FromResult(context);
}
},
};
facebookOptions.Scope.Add("email");
facebookOptions.Scope.Add("public_profile");
facebookOptions.Scope.Add("user_friends");
app.UseFacebookAuthentication(facebookOptions);
Run Code Online (Sandbox Code Playgroud)
在for each循环中,我试图将所有Facebook声明存储在Identity中,但是当我回到SecurityTokenValidated回调中时,我的身份并没有它们.
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions() {
Authority = "https://localhost:44302/identity/",
ClientId = "my_client",
Scope = "openid profile roles email",
RedirectUri …Run Code Online (Sandbox Code Playgroud) 如果我有以下路线:
{controller}/{action}/{id}
Run Code Online (Sandbox Code Playgroud)
我查看以下网址:
c1/a1/abc.
Run Code Online (Sandbox Code Playgroud)
它不起作用.仅当句点位于URL的末尾时才会发生这种情况.有什么办法让ASP.NET MVC识别出作为ID的一部分?
asp.net-mvc ×3
c# ×3
routing ×2
.net-core ×1
bash ×1
dataprovider ×1
ef-core-2.0 ×1
itext ×1
resharper ×1
sqlite ×1
unix ×1
url ×1