Skip to content

Commit 8b457a0

Browse files
author
Maximilian
committed
Upgraded main aspnet core project to 2.0
1 parent 112bb3c commit 8b457a0

File tree

5 files changed

+53
-95
lines changed

5 files changed

+53
-95
lines changed

Mvc.JQuery.DataTables.AspNetCore.Example/Mvc.JQuery.DataTables.AspNetCore.Example.csproj

Lines changed: 5 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp1.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
</PropertyGroup>
66

77
<PropertyGroup>
8-
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
98
<RootNamespace>Mvc.JQuery.DataTables.Example</RootNamespace>
109
</PropertyGroup>
1110

1211
<ItemGroup>
13-
<Content Include="wwwroot\Content\jquery.dataTables.lang.de-DE.txt" />
14-
<Content Include="wwwroot\Content\qunit-1.14.0.css" />
15-
<Content Include="wwwroot\Content\Site.css" />
16-
<Content Include="wwwroot\Content\themes\Aristo\images\bg_fallback.png" />
17-
<Content Include="wwwroot\Content\themes\Aristo\images\icon_sprite.png" />
18-
<Content Include="wwwroot\Content\themes\Aristo\images\progress_bar.gif" />
19-
<Content Include="wwwroot\Content\themes\Aristo\images\slider_handles.png" />
20-
<Content Include="wwwroot\Content\themes\Aristo\images\ui-icons_222222_256x240.png" />
21-
<Content Include="wwwroot\Content\themes\Aristo\images\ui-icons_454545_256x240.png" />
22-
<Content Include="wwwroot\Content\themes\Aristo\jquery-ui-1.8.7.custom.css" />
23-
<Content Include="wwwroot\Content\themes\base\accordion.css" />
24-
<Content Include="wwwroot\Content\themes\base\all.css" />
25-
<Content Include="wwwroot\Content\themes\base\autocomplete.css" />
26-
<Content Include="wwwroot\Content\themes\base\base.css" />
27-
<Content Include="wwwroot\Content\themes\base\button.css" />
28-
<Content Include="wwwroot\Content\themes\base\core.css" />
29-
<Content Include="wwwroot\Content\themes\base\datepicker.css" />
30-
<Content Include="wwwroot\Content\themes\base\dialog.css" />
31-
<Content Include="wwwroot\Content\themes\base\draggable.css" />
32-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
33-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />
34-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_glass_55_fbf9ee_1x400.png" />
35-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_glass_65_ffffff_1x400.png" />
36-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_glass_75_dadada_1x400.png" />
37-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_glass_75_e6e6e6_1x400.png" />
38-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_glass_95_fef1ec_1x400.png" />
39-
<Content Include="wwwroot\Content\themes\base\images\ui-bg_highlight-soft_75_cccccc_1x100.png" />
40-
<Content Include="wwwroot\Content\themes\base\images\ui-icons_222222_256x240.png" />
41-
<Content Include="wwwroot\Content\themes\base\images\ui-icons_2e83ff_256x240.png" />
42-
<Content Include="wwwroot\Content\themes\base\images\ui-icons_454545_256x240.png" />
43-
<Content Include="wwwroot\Content\themes\base\images\ui-icons_888888_256x240.png" />
44-
<Content Include="wwwroot\Content\themes\base\images\ui-icons_cd0a0a_256x240.png" />
45-
<Content Include="wwwroot\Content\themes\base\jquery-ui.css" />
46-
<Content Include="wwwroot\Content\themes\base\jquery.ui.accordion.css" />
47-
<Content Include="wwwroot\Content\themes\base\jquery.ui.all.css" />
48-
<Content Include="wwwroot\Content\themes\base\jquery.ui.autocomplete.css" />
49-
<Content Include="wwwroot\Content\themes\base\jquery.ui.base.css" />
50-
<Content Include="wwwroot\Content\themes\base\jquery.ui.button.css" />
51-
<Content Include="wwwroot\Content\themes\base\jquery.ui.core.css" />
52-
<Content Include="wwwroot\Content\themes\base\jquery.ui.datepicker.css" />
53-
<Content Include="wwwroot\Content\themes\base\jquery.ui.dialog.css" />
54-
<Content Include="wwwroot\Content\themes\base\jquery.ui.progressbar.css" />
55-
<Content Include="wwwroot\Content\themes\base\jquery.ui.resizable.css" />
56-
<Content Include="wwwroot\Content\themes\base\jquery.ui.selectable.css" />
57-
<Content Include="wwwroot\Content\themes\base\jquery.ui.slider.css" />
58-
<Content Include="wwwroot\Content\themes\base\jquery.ui.tabs.css" />
59-
<Content Include="wwwroot\Content\themes\base\jquery.ui.theme.css" />
60-
<Content Include="wwwroot\Content\themes\base\menu.css" />
61-
<Content Include="wwwroot\Content\themes\base\minified\jquery-ui.min.css" />
62-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.accordion.min.css" />
63-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.all.min.css" />
64-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.autocomplete.min.css" />
65-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.base.min.css" />
66-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.button.min.css" />
67-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.core.min.css" />
68-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.datepicker.min.css" />
69-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.dialog.min.css" />
70-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.progressbar.min.css" />
71-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.resizable.min.css" />
72-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.selectable.min.css" />
73-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.slider.min.css" />
74-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.tabs.min.css" />
75-
<Content Include="wwwroot\Content\themes\base\minified\jquery.ui.theme.min.css" />
76-
<Content Include="wwwroot\Content\themes\base\progressbar.css" />
77-
<Content Include="wwwroot\Content\themes\base\resizable.css" />
78-
<Content Include="wwwroot\Content\themes\base\selectable.css" />
79-
<Content Include="wwwroot\Content\themes\base\selectmenu.css" />
80-
<Content Include="wwwroot\Content\themes\base\slider.css" />
81-
<Content Include="wwwroot\Content\themes\base\sortable.css" />
82-
<Content Include="wwwroot\Content\themes\base\spinner.css" />
83-
<Content Include="wwwroot\Content\themes\base\tabs.css" />
84-
<Content Include="wwwroot\Content\themes\base\theme.css" />
85-
<Content Include="wwwroot\Content\themes\base\tooltip.css" />
86-
</ItemGroup>
87-
<ItemGroup>
88-
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
89-
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
90-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" />
91-
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.0.1" />
12+
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.*" />
13+
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.*" />
14+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.*" />
15+
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.*" />
9216
</ItemGroup>
9317
<ItemGroup>
9418
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />

Mvc.JQuery.DataTables.AspNetCore/DataTablesModelBinder.cs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.AspNetCore.Mvc.ModelBinding;
2+
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
23
using System;
34
using System.Threading.Tasks;
45

@@ -99,9 +100,42 @@ private DataTablesParam BindLegacyModel(IValueProvider valueProvider, int column
99100
private static T GetValue<T>(IValueProvider valueProvider, string key)
100101
{
101102
ValueProviderResult valueResult = valueProvider.GetValue(key);
102-
return (valueResult==null)
103+
return (valueResult == null)
103104
? default(T)
104-
: (T)valueResult.ConvertTo(typeof(T));
105+
: ConvertTo<T>(valueResult);
106+
}
107+
108+
/// <summary>
109+
/// Attempts to convert the values in <paramref name="result"/> to the specified type.
110+
/// </summary>
111+
/// <typeparam name="T">The <see cref="Type"/> for conversion.</typeparam>
112+
/// <param name="result">The <see cref="ValueProviderResult"/>.</param>
113+
/// <returns>
114+
/// The converted value, or the default value of <typeparamref name="T"/> if the value could not be converted.
115+
/// </returns>
116+
/// <remarks>
117+
/// Copyright (c) .NET Foundation and Contributors
118+
/// All rights reserved.
119+
/// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
120+
/// this file except in compliance with the License.You may obtain a copy of the license at:
121+
/// http://www.apache.org/licenses/LICENSE-2.0
122+
/// Unless required by applicable law or agreed to in writing, software distributed
123+
/// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
124+
/// CONDITIONS OF ANY KIND, either express or implied. See the License for the
125+
/// specific language governing permissions and limitations under the License.
126+
/// </remarks>
127+
private static T ConvertTo<T>(ValueProviderResult result)
128+
{
129+
object valueToConvert = null;
130+
if (result.Values.Count == 1)
131+
{
132+
valueToConvert = result.Values[0];
133+
}
134+
else if (result.Values.Count > 1)
135+
{
136+
valueToConvert = result.Values.ToArray();
137+
}
138+
return ModelBindingHelper.ConvertTo<T>(valueToConvert, result.Culture);
105139
}
106140
}
107141

Mvc.JQuery.DataTables.AspNetCore/Mvc.JQuery.DataTables.AspNetCore.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
55
<RootNamespace>Mvc.JQuery.DataTables</RootNamespace>
66
<AssemblyName>Mvc.JQuery.DataTables.AspNetCore</AssemblyName>
77
<PackageId>Mvc.JQuery.DataTables.AspNetCore</PackageId>
@@ -16,9 +16,9 @@
1616
<PackageLicenseUrl>https://github.com/mcintyre321/mvc.jquery.datatables/blob/master/License.txt</PackageLicenseUrl> </PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
20-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" />
21-
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="1.1.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.*" />
20+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.*" />
21+
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.0.*" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

Mvc.JQuery.DataTables.Common/Mvc.JQuery.DataTables.Common.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
</ItemGroup>
2525

2626
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
27-
<PackageReference Include="System.ComponentModel.Annotations" Version="4.1.0" />
28-
<PackageReference Include="System.ComponentModel.Primitives" Version="4.1.0" />
29-
<PackageReference Include="System.Reflection" Version="4.1.0" />
30-
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.1.0" />
27+
<PackageReference Include="System.ComponentModel.Annotations" Version="4.3.0" />
28+
<PackageReference Include="System.ComponentModel.Primitives" Version="4.3.0" />
29+
<PackageReference Include="System.Reflection" Version="4.3.0" />
30+
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
3131
</ItemGroup>
3232

3333
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">

Mvc.JQuery.Datatables.Templates/Mvc.JQuery.Datatables.Templates.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
15-
<PackageReference Include="System.ComponentModel.Annotations" Version="4.1.0" />
16-
<PackageReference Include="System.ComponentModel.Primitives" Version="4.1.0" />
17-
<PackageReference Include="System.Reflection" Version="4.1.0" />
18-
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.1.0" />
15+
<PackageReference Include="System.ComponentModel.Annotations" Version="4.3.0" />
16+
<PackageReference Include="System.ComponentModel.Primitives" Version="4.3.0" />
17+
<PackageReference Include="System.Reflection" Version="4.3.0" />
18+
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
1919
</ItemGroup>
2020

2121
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">

0 commit comments

Comments
 (0)