在我的ASP.NET 5(RC1)代码中,我有一个appsetting.json,看起来像这样:
{
"SomeSettings": {
"PropA": "ValueA",
"PropB": [
"ValueB1",
"ValueB2"
]
}
}
Run Code Online (Sandbox Code Playgroud)
在我的开发机器上运行代码时使用这些值(即localhost).如果我想覆盖wep应用程序的Azure应用程序设置中的"SomeSettings",我将如何指定"PropB"数组?
我想要存储信息的SomeSettings.cs类如下所示:
public class SomeSettings
{
public string PropA { get; set; }
public List<string> PropB { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
问题是"PropB" - 如何在Azure中将数组或List指定为字符串 - 这是否可能?
在我的Startup类的构造函数中,我有:
var builder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddEnvironmentVariables();
Run Code Online (Sandbox Code Playgroud)
在我的Startup类的配置方法中,我有:
var someSettings = configuration.GetSection("SomeSettings").Get<SomeSettings>();
Run Code Online (Sandbox Code Playgroud) 我在Visual Studio中有两个独立的项目 - 一个带有WebAPI,另一个带有MVC网站......
我是否可以将这两个发布到同一个Azure网站,以便请求: - /api/products/=>从WebAPI提供JSON - /products/=>从MVC网站提供HTML
我有一个TextBox绑定到Entity-object上的Text-property.我希望能够重新格式化用户在某些情况下输入的文本 - 例如,如果用户输入"2/4"(一小部分) - 我想将其更改为"1/2".
通过Text-property的"set-part",我可以更改Entity-object上的值,但这不会出现在TextBox中 - 它仍然显示为"2/4"?
我如何在代码隐藏中形成我的构造函数以获取对下面 XAML 中 OuterBorder 控件的引用?
<Window Template="{DynamicResource WindowTemplate}">
<Window.Resources>
<ControlTemplate x:Key="WindowTemplate" TargetType="{x:Type Window}">
<AdornerDecorator>
<Border Name="OuterBorder" Background="Black" BorderBrush="Red" BorderThickness="1" CornerRadius="0">
<!-- Implementation here... -->
</Border>
</AdornerDecorator>
</ControlTemplate>
</Window.Resources>
</Window>
Run Code Online (Sandbox Code Playgroud) azure ×2
wpf ×2
.net ×1
asp.net-core ×1
asp.net-mvc ×1
c# ×1
data-binding ×1
publish ×1
resources ×1