Skip to content

Commit

Permalink
Merge pull request #400 from jespersh/master
Browse files Browse the repository at this point in the history
Target net5.0 and netstandard2.x and set either EditForm's Model or EditContext
  • Loading branch information
jbomhold3 authored Oct 13, 2020
2 parents d7bfb3f + 5863bf1 commit 8b48193
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 41 deletions.
2 changes: 1 addition & 1 deletion BlazorStrap.Tests/BlazorStrap.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<PackageId>BlazorStrap.Extensions.BSDataTable</PackageId>
<Version>1.0.1-Preview-01</Version>
Expand All @@ -14,7 +14,11 @@
</PropertyGroup>


<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0-rc.1.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0-rc.1.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<LangVersion>8.0</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
Expand All @@ -19,9 +19,14 @@
<AssemblyName>BlazorStrap.Extensions.FluentValidation</AssemblyName>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0-rc.1.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentValidation" Version="8.6.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<PackageId>BlazorStrap.Extensions.SVGLoader</PackageId>
<Version>1.0.0</Version>
Expand All @@ -13,9 +13,15 @@
</PropertyGroup>


<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0-rc.1.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0-rc.1.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BlazorComponentUtilities" Version="1.6.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<PackageId>BlazorStrap.Extensions.TreeView</PackageId>
<Version>1.0.5</Version>
Expand All @@ -15,7 +15,11 @@
</PropertyGroup>


<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0-rc.1.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0-rc.1.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
</ItemGroup>
Expand Down
9 changes: 7 additions & 2 deletions src/BlazorStrap/BlazorStrap.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<IsPackable>true</IsPackable>
<LangVersion>8.0</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
Expand All @@ -17,9 +17,14 @@
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0-preview.9.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BlazorComponentUtilities" Version="1.6.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
18 changes: 12 additions & 6 deletions src/BlazorStrap/Components/Forms/BSForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,18 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
Formbuilder.OpenComponent<EditForm>(0);
Formbuilder.AddMultipleAttributes(1, AdditionalAttributes);
Formbuilder.AddAttribute(2, "class", Classname);
Formbuilder.AddAttribute(3, "Model", Model);
Formbuilder.AddAttribute(4, "EditContext", EditContext);
Formbuilder.AddAttribute(5, "OnSubmit", OnSubmit);
Formbuilder.AddAttribute(6, "OnValidSubmit", OnValidSubmit);
Formbuilder.AddAttribute(7, "OnInvalidSubmit", OnInvalidSubmit);
Formbuilder.AddAttribute(8, "ChildContent", ChildContent);
if (EditContext != null)
{
Formbuilder.AddAttribute(3, "EditContext", EditContext);
}
else
{
Formbuilder.AddAttribute(3, "Model", Model);
}
Formbuilder.AddAttribute(4, "OnSubmit", OnSubmit);
Formbuilder.AddAttribute(5, "OnValidSubmit", OnValidSubmit);
Formbuilder.AddAttribute(6, "OnInvalidSubmit", OnInvalidSubmit);
Formbuilder.AddAttribute(7, "ChildContent", ChildContent);
Formbuilder.CloseComponent();
};

Expand Down
17 changes: 3 additions & 14 deletions src/BlazorStrap/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/BlazorStrap/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Between 1 and 12" xml:space="preserve">
<value>Must be between 1 and 12</value>
<data name="Between 0 and 12" xml:space="preserve">
<value>Must be between 0 and 12</value>
</data>
<data name="Between 1 and 12 Auto" xml:space="preserve">
<value>Must be \"auto\" or between 1 and 12</value>
Expand Down
14 changes: 9 additions & 5 deletions src/Sample/ClientSideSample.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>8.0</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<TargetFrameworks>net5.0</TargetFrameworks>

</PropertyGroup>

<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0-rc.1.*" />
<!--<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="5.0.0-rc.1.*" />-->
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.0-rc.1.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0-rc.1.*" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
Expand Down
9 changes: 7 additions & 2 deletions src/SampleCore/SampleCore.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.0-rc.1.*" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BlazorPrettyCode" Version="1.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ServerSideSample/ServerSideSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFrameworks>netcoreapp3.0;net5.0</TargetFrameworks>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

Expand Down

0 comments on commit 8b48193

Please sign in to comment.