一个新的.net核心Web应用程序项目带有以下路由配置:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
Run Code Online (Sandbox Code Playgroud)
如果将其替换为HomeController及其操作(索引,关于,联系人,错误)并为其app.UseMvc()添加适当的Route属性,它仍然可以工作.由于我们没有指定默认路由,因此如果您点击http:// localhost:25137 /,则不会呈现默认视图(Home/Index).希望理解是正确的!
现在,因为我需要在http:// localhost:25137 /被命中时显示默认视图,所以我更改了路由代码app.UseMvcWithDefaultRoute();,根据定义,它将与初始代码段相同.即使这样,它也没有呈现默认视图; 但在使用完整的URL(http:// localhost:25137/home/index)时工作.这意味着路由仍然有效但不是默认路由!
然后我回到控制器并Route从HomeController及其动作中删除了所有属性.然后默认路由可以解决任何问题.
这是预期的行为吗?这种行为背后的原因是什么?
许多像这样的stackoverflow链接的帖子声称PostgreSQL中没有聚集索引的概念.但是,PostgreSQL文档包含类似的内容.一些人声称它类似于SQL Server中的聚簇索引.
你知道这两者之间的确切区别是什么,如果有的话?
我的新客户计划使用 Azure 托管 SQL 数据库服务。我正在使用 dacpac 来部署数据库。在 dacpac 中,我有一个部署后脚本来创建一个 sql 用户,如下所示
IF NOT EXISTS (SELECT name
FROM sys.server_principals
WHERE name = 'myusername')
BEGIN
CREATE LOGIN myusername
WITH PASSWORD = '******';
END
GO
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试在 Azure(使用目标平台 - Microsoft Azure SQL 数据库 V12 编译)中应用 dacpac 时,它会引发以下错误。
An error occurred while the batch was being executed.
Updating database (Failed)
*** Could not deploy package.
Error SQL72014: .Net SqlClient Data Provider: Msg 208, Level 16, State 1, Line 4 Invalid object name 'sys.server_principals'.
Error SQL72045: …Run Code Online (Sandbox Code Playgroud) 我正在尝试按照https://www.webcomponents.org/polyfills/中的解释来填充web组件,因为我希望我的示例应用程序可以在Chrome和Firefox上运行.但是我得到了ReferenceError:Firefox中没有定义customElements错误.请参阅下面的index.html代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="index, follow">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Sample</title>
<link rel="stylesheet" href="css/site.css">
<!-- Components -->
<link rel="import" href="components/global/site-navigation.html">
</head>
<body>
<script>
(function () {
if ('registerElement' in document
&& 'import' in document.createElement('link')
&& 'content' in document.createElement('template')) {
// platform is good!
} else {
// polyfill the platform!
var e = document.createElement('script');
e.src = 'js/webcomponents.js';
document.body.appendChild(e);
}
})();
</script>
<site-navigation></site-navigation>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
PS:Chrome中一切正常(有/无填充)
.net-core ×1
asp.net-mvc ×1
azure ×1
dacpac ×1
html-imports ×1
javascript ×1
polyfills ×1
postgresql ×1
shadow-dom ×1
sql-server ×1
t-sql ×1