小编Sim*_*ich的帖子

Angular 2访问基础href

我的解决方案中有一个代码,它获取应用程序的baseHref

constructor( private router: Router) {
    let baseHref = this.router._location._baseHref;
Run Code Online (Sandbox Code Playgroud)

你可以通过私有财产看到我得到的东西.有没有其他方法来获得基本网址?又名路由器添加它的部分之前的网址?

我正在使用angular2 rc4

谢谢

angular2-routing angular

14
推荐指数
1
解决办法
2万
查看次数

获取按类型设置的实体

我有一个可以在.Net 4.6中使用EF6的代码,但是不能在ef.core中使用。编译器报告

方法'Set'的重载不接受1个参数(CS1501)

  Type type = Type.GetType("ContextName.SomeModel");
  if (type == null) return null;

   var entity = db.Set(type).Find(id);
Run Code Online (Sandbox Code Playgroud)

基本上,我是通过字符串名称获取对象的。如何在.core(v 2.0)中实现呢?

我的进口:

using System;
using System.Collections;
using System.Collections.Generic;

using System.Linq;
using System.Reflection;

using System.Linq.Dynamic.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Shared.Web.MvcExtensions;
Run Code Online (Sandbox Code Playgroud)

c# entity-framework-core

4
推荐指数
1
解决办法
1730
查看次数

nativescript在后端web api进行身份验证

我是移动开发的新手.我的项目是使用asp.net构建的.对于身份验证我正在使用构建它UserManager和User.Identity.

我有一堆现有的网络api,我希望从移动应用程序中使用它们.我知道,我可以在验证后将秘密哈希传递给web api,但这将涉及巨大的代码重构.

我一直想知道是否还有其他方法可以使用nativescript和asp.net处理身份验证和授权.

你知道这个主题的任何有用资源吗?

非常感谢您的帮助!

asp.net authentication asp.net-mvc nativescript angular

1
推荐指数
1
解决办法
1736
查看次数