升级到Angular 6.0和Rxjs到6.0后,我收到以下编译错误:
Property 'do' does not exist on type 'Observable'.
这是代码:
import { Observable, of } from 'rxjs';
import 'rxjs/add/operator/do';
import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/catch';
import { IProduct } from './product';
@Injectable()
export class ProductService {
constructor(
private product: IProduct)
{
}
getProduct = () => {
return product.products
// error on next line
.do(data => console.log('All:' + JSON.stringify(data)))
.catch(this.handleError);
}
private handleError(err: HttpErrorResponse) {
console.log(err.message);
return Observable.throw(err.message);
}
}
Run Code Online (Sandbox Code Playgroud)
任何的想法?
我已经脚手架AspNetCore Angular 6.0 SPA template从cli再安装npm相应的软件包.
但是,当我尝试运行该项目时,dotnet run它不会启动而是错误提示.我抓了一个截图供你参考.我不确定它是否与angular.Json文件有关,否则!任何的想法..
错误:
未知选项--extractCss
我一直收到此错误,并且我在网上搜索了答案,几乎所有人都在谈论 requesturis,我已经仔细检查以确保我的 uri 配置正确。我没有找到任何线索。有什么想法吗。
身份服务器 4 设置:-
public static IEnumerable<Client> GetClients()
{
return new List<Client>()
{
new Client
{
ClientName="KtsWeb App",
ClientId="ktswebclient",
AllowedGrantTypes= GrantTypes.Hybrid,
AccessTokenType = AccessTokenType.Reference,
RedirectUris = new List<string>()
{
"https://localhost:44355/signin-oidc" //Client URL Address
},
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
IdentityServerConstants.StandardScopes.Profile
}
}
};
}
Run Code Online (Sandbox Code Playgroud)
客户端设置:-
services.AddAuthentication(options =>
{
options.DefaultScheme = "Cookies";
options.DefaultChallengeScheme = "oidc";
}).AddCookie("Cookies",
(options) =>
{
options.AccessDeniedPath = "/Authorization/AccessDenied";
})
.AddOpenIdConnect("oidc", options =>
{
options.SignInScheme = "Cookies";
options.Authority = "https://localhost:44380"; //Identity Server URL Address
options.ClientId = …Run Code Online (Sandbox Code Playgroud) 我的计算机上安装了 SSMS 15.4、SQL Server 2019 和 SQL Server 2016 LocalDB。我在 VS 2019 中为实践项目创建了几个数据库,它们在 VS 2019 的 SQL Server 对象资源管理器中(localdb)\MSSQLLocalDB(SQL Server 13.0) 下都显示良好。当我启动 SSMS 并通过 Windows 身份验证连接到服务器名称(这是我的计算机名称)时,这些数据库不会列出。我很困惑如何在 SSMS 中获取这些数据库。我已通过剪切附加了图像,我希望社区中的人能帮助我:-
从 VS 2019 创建的数据库映像:
来自 SSMS 数据库图像:
我无法在 ASP.NET Core 中处理我的路由规则。我有以下用户身份验证操作方法的后端和前端应用程序。由于这两种操作方法在有效载荷中都有一个参数不同或附加参数。Http 客户端实际上无法导航精确的方法,因此会抛出一个错误“歧义”的异常,这是真的,因为这两个 HttpPost 方法都有一个带有不同参数的参数。如何确保该方法根据操作触发。代码如下:-
API控制器:-
[Route("api/[controller]")]
public class AccountController: Controller
{
[HttpPost, ActionName("Login")]
public async Task<IActionResult> UserLogin(LoginDto user)
{
//Code goes here
}
[HttpPost, ActionName("Register")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> UserRegistration(RegisterDto register)
{
//Code goes here
}
}
Run Code Online (Sandbox Code Playgroud)
前端API服务
public async Task<IActionResult> GetLoginAsync(LoginDto loginUser)
{
var request = "/api/account";
var content = new StringContent(JsonConvert.SerializeObject(loginUser), Encoding.UTF8, "application/json");
try
{
var result = await ExecuteWithResiliencePolicies(() => _client.PostAsync(request, content));
return new StatusCodeResult((int)result.StatusCode);
}
catch (HttpRequestException)
{
return new StatusCodeResult(StatusCodes.Status503ServiceUnavailable);
}
} …Run Code Online (Sandbox Code Playgroud) asp.net-core ×3
angular ×2
c# ×2
angular6 ×1
asp.net ×1
asp.net-mvc ×1
rxjs6 ×1
sql-server ×1
ssms ×1