小编use*_*973的帖子

如何从MVC5应用程序中使用Asp.Identity进行身份验证的用户的Google帐户获取FirstName + LastName

我创建了一个MVC 5应用程序,并且我能够使用Google外部登录验证用户,这是一个开箱即用的功能.我观察到,通过使用谷歌帐户验证用户,用户名和电子邮件存储在具有相同值的数据库中(即,两者都有电子邮件).如何从注册的Google帐户中检索FirstName,LastName.

asp.net-mvc asp.net-identity

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

Swashbuckle招摇是行不通的

我有一个web api 2项目.它被配置为使用owin自托管.它没有任何global.asax文件.我需要有关于web api的帮助页面,并且已经使用了swaschbuckle.但是rooturl/swagger/docs没有提供任何输出.我按照这里的说明' https://github.com/domaindrivendev/Swashbuckle/issues/196 ',但它仍然无法正常工作.以下是我的配置代码

public void Configuration(IAppBuilder app)
{
    // Configure DI
    container = BuildDI();

    // Create the configuration. OWIN Should create a new httpconfiguration.
    // GlobalConfiguration can't be used.
    HttpConfiguration = new HttpConfiguration();

    HttpConfiguration.Formatters.XmlFormatter.UseXmlSerializer = true;
    HttpConfiguration.MapHttpAttributeRoutes();
    HttpConfiguration.DependencyResolver = new AutofacWebApiDependencyResolver(container);

    // Set ServicePointManager properties.
    ServicePointManager.ServerCertificateValidationCallback = ((sender, cert, chain, sslPolicyErrors) => true);

    // 10 concurrent connections can be made on the service point.
    ServicePointManager.DefaultConnectionLimit = 10;

    // After the idle time expires, the ServicePoint object is …
Run Code Online (Sandbox Code Playgroud)

c# swagger asp.net-web-api2 swashbuckle

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

无法在aspnet核心的startup.cs文件中找到Use.RunTimePageInfo()方法

我跟随Scott Allen在Ubuntu 16.04 .Net Core 1.0.0框架中的Asp.Net核心复数课程.我无法在StartUp.cs文件中的Configure方法中找到app.UseRuntimeInfoPage方法,即使我已包含Microsoft.AspNetCore.Diagnostics.在提供的功能方面,框架是否对非Windows操作系统有限制?

来自Scott Allens课程的StartUp.cs代码


    using Microsoft.AspNet.Builder;
    using Microsoft.AspNet.Hosting;
    using Microsoft.AspNet.Http;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Configuration;
    using OdeToFood.Services;

    namespace OdeToFood
    {
        public class Startup
        {
            public Startup()
            {
                var builder = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json");
                Configuration = builder.Build();
            }

            public IConfiguration Configuration { get; set; }

            // This method gets called by the runtime. Use this method to add services to the container.
            // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
            public void ConfigureServices(IServiceCollection services) …

.net c# asp.net

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

全日历多个营业时间,每天两班

我已将完整日历整合到我的网站中.我的一个要求是从数据库中获取营业时间并在日历上呈现它.所以基本上每天都有两班(早上和晚上).我需要能够创建一个营业时间数组,并从数据库中填充值.开箱即用,我可以使用以下代码来渲染常见的营业时间.

businessHours:
  {
    start: '10:00:00',
    end: '16:00:00',
    dow: [0,1,2,3,4,5,6]
  },
Run Code Online (Sandbox Code Playgroud)

我希望实现这样的目标:

businessHours:[
{
  start: '10:00:00',
  end: '13:00:00',
  dow: [0]
},
{
  start: '14:00:00',
  end: '19:00:00',
  dow: [0]
},
{
  start: '09:00:00',
  end: '12:00:00',
  dow: [1]
},
{
  start: '12:30:00',
  end: '18:00:00',
  dow: [1]
},
]
Run Code Online (Sandbox Code Playgroud)

如果使用完整日历的现有属性无法做到这一点,还有其他方法可以实现吗?先感谢您.

javascript fullcalendar

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

JSSProvider 不使用 classNamePrefix 生成类前缀

我在我的 React 项目中使用 material-react。我们在 shell 和微前端都使用了 material-react。shell 和微前端生成的类名相同,即 , .jss1.jss2这会导致样式冲突。

我试着去产生微前端独特的类名,像App1-{className}使用JssProviderclassNamePrefix道具,但还是被类名产生,因为它是(.jss1.jss2等等)。我已经安装react-jss@10.0.0到现在。我也尝试了许多来自 stackoverflow 和 github 问题的解决方案。但他们都没有为我工作。

import React from "react";
import ReactDOM from "react-dom";
import { JssProvider } from "react-jss";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import App from "./components/App";
import "./styles.css";
import { Provider } from "react-redux";

const routing = (
  <JssProvider classNamePrefix="App1">
    <Provider>
      <Router>
        <Switch>
          <Route exact path="/" component={App} />
        </Switch>
      </Router> …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs material-ui jss

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