Skip to content

Commit e69efe1

Browse files
committed
Target net461 and update CsvHelper and Dapper
1 parent cd9593f commit e69efe1

40 files changed

+237
-209
lines changed

Build/CommonAssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
//
1616
// You can specify all the values or you can default the Revision and Build Numbers
1717
// by using the '*' as shown below:
18-
[assembly: AssemblyVersion("3.6.1")]
19-
[assembly: AssemblyFileVersion("3.6.1")]
18+
[assembly: AssemblyVersion("3.6.2")]
19+
[assembly: AssemblyFileVersion("3.6.2")]
2020
//[assembly: AssemblyInformationalVersion("2.5-filters")]

Build/Griddly.Core.nuspec

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
<language>en-US</language>
1515

1616
<dependencies>
17-
<group targetFramework="net45">
18-
<dependency id="CsvHelper" version="6.1.1" />
19-
<dependency id="Dapper" version="1.50.2" />
17+
<group targetFramework="net461">
18+
<dependency id="CsvHelper" version="27.1.1" />
19+
<dependency id="Dapper" version="2.0.90" />
2020
<dependency id="EPPlus" version="4.5.3" />
2121
<dependency id="Newtonsoft.Json" version="11.0.2" />
2222
</group>
2323
<group targetFramework="netcoreapp3.1">
24-
<dependency id="CsvHelper" version="6.1.1" />
25-
<dependency id="Dapper" version="1.50.2" />
24+
<dependency id="CsvHelper" version="27.1.1" />
25+
<dependency id="Dapper" version="2.0.90" />
2626
<dependency id="EPPlus" version="4.5.3" />
2727
<dependency id="Newtonsoft.Json" version="11.0.2" />
2828
</group>
2929
<group targetFramework="net5.0">
30-
<dependency id="CsvHelper" version="6.1.1" />
31-
<dependency id="Dapper" version="1.50.2" />
30+
<dependency id="CsvHelper" version="27.1.1" />
31+
<dependency id="Dapper" version="2.0.90" />
3232
<dependency id="EPPlus" version="4.5.3" />
3333
<dependency id="Newtonsoft.Json" version="11.0.2" />
3434
</group>

Build/Griddly.nuspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<description>Pagable, sortable, MVC enabled grid</description>
1313
<language>en-US</language>
1414
<dependencies>
15-
<group targetFramework="net45">
15+
<group targetFramework="net461">
1616
<dependency id="Griddly.Core" version="" />
1717
</group>
1818
<group targetFramework="netcoreapp3.1">

Build/build.proj

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
<RemoveDir Directories="$(BaseDir)\Griddly\obj" />
2424

2525
<ItemGroup>
26-
<!--net45 items-->
26+
<!--net461 items-->
2727
<Content Include="$(BaseDir)\Griddly\**\griddly.js" />
2828
<Content Include="$(BaseDir)\Griddly\**\griddly.css" />
2929
<Content Include="$(BaseDir)\Griddly\**\Views\Shared\Griddly\*.*" />
30-
<Libs Include="$(BaseDir)\Griddly.Mvc\bin\$(Configuration)\net45\Griddly.Mvc.dll" />
30+
<Libs Include="$(BaseDir)\Griddly.Mvc\bin\$(Configuration)\net461\Griddly.Mvc.dll" />
3131

3232
<!--coreapp items-->
3333
<LibsCoreApp Include="$(BaseDir)\Griddly.Mvc\bin\$(Configuration)\netcoreapp3.1\Griddly.Mvc.dll" />
@@ -46,18 +46,18 @@
4646
<Copy SourceFiles="$(MSBuildProjectDirectory)\Griddly.Core.nuspec" DestinationFolder="$(PackageDir)\Griddly.Core" />
4747

4848
<!-- Copy the source files to the package dir -->
49-
<Copy SourceFiles="@(Content)" DestinationFolder="$(PackageDir)\Griddly\content\net45\%(RecursiveDir)" />
50-
<Copy SourceFiles="@(Libs)" DestinationFolder="$(PackageDir)\Griddly.Core\lib\net45\%(RecursiveDir)" />
49+
<Copy SourceFiles="@(Content)" DestinationFolder="$(PackageDir)\Griddly\content\net461\%(RecursiveDir)" />
50+
<Copy SourceFiles="@(Libs)" DestinationFolder="$(PackageDir)\Griddly.Core\lib\net461\%(RecursiveDir)" />
5151
<Copy SourceFiles="@(ContentCoreApp)" DestinationFolder="$(PackageDir)\Griddly\staticwebassets\%(RecursiveDir)" />
5252
<Copy SourceFiles="@(LibsCoreApp)" DestinationFolder="$(PackageDir)\Griddly.Core\lib\netcoreapp\%(RecursiveDir)" />
5353
<Copy SourceFiles="@(LibsCoreAppRazor)" DestinationFolder="$(PackageDir)\Griddly\lib\netcoreapp\%(RecursiveDir)" />
5454
<Copy SourceFiles="@(BuildCoreApp)" DestinationFolder="$(PackageDir)\Griddly\%(RecursiveDir)" />
5555

5656
<!-- Get the version number of the main assembly to insert into the nuspec files -->
57-
<GetAssemblyIdentity AssemblyFiles="$(PackageDir)\Griddly.Core\lib\net45\Griddly.Mvc.dll">
57+
<GetAssemblyIdentity AssemblyFiles="$(PackageDir)\Griddly.Core\lib\net461\Griddly.Mvc.dll">
5858
<Output TaskParameter="Assemblies" ItemName="AsmInfo" />
5959
</GetAssemblyIdentity>
60-
<GetAssemblyInformationalVersion AssemblyFile="$(PackageDir)\Griddly.Core\lib\net45\Griddly.Mvc.dll">
60+
<GetAssemblyInformationalVersion AssemblyFile="$(PackageDir)\Griddly.Core\lib\net461\Griddly.Mvc.dll">
6161
<Output TaskParameter="Value" ItemName="AssemblyVersion" />
6262
</GetAssemblyInformationalVersion>
6363
<PropertyGroup>

Griddly.Mvc/Griddly.Mvc.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net45</TargetFrameworks>
4+
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
55
<RootNamespace>Griddly.Mvc</RootNamespace>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
</PropertyGroup>
@@ -21,8 +21,8 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="CsvHelper" Version="6.1.1" />
25-
<PackageReference Include="Dapper" Version="1.50.2" />
24+
<PackageReference Include="CsvHelper" Version="27.1.1" />
25+
<PackageReference Include="Dapper" Version="2.0.90" />
2626
<PackageReference Include="EPPlus" Version="4.5.3" />
2727
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
2828
</ItemGroup>

Griddly.Mvc/GriddlyButton.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3-
#if NET45
3+
#if NET45_OR_GREATER
44
using System.Web.Mvc;
55
#else
66
using System.Net.Http;
@@ -70,7 +70,7 @@ public GriddlyButton Add(GriddlyButton item)
7070
}
7171

7272
public
73-
#if NET45
73+
#if NET45_OR_GREATER
7474
HttpVerbs
7575
#else
7676
HttpMethod
@@ -82,7 +82,7 @@ public GriddlyButton Add(GriddlyButton item)
8282
switch (Action)
8383
{
8484
case GriddlyButtonAction.Navigate:
85-
#if NET45
85+
#if NET45_OR_GREATER
8686
return HttpVerbs.Get;
8787
#else
8888
return HttpMethod.Get;
@@ -91,13 +91,13 @@ public GriddlyButton Add(GriddlyButton item)
9191
case GriddlyButtonAction.PostCriteria:
9292
case GriddlyButtonAction.Ajax:
9393
case GriddlyButtonAction.AjaxBulk:
94-
#if NET45
94+
#if NET45_OR_GREATER
9595
return HttpVerbs.Post;
9696
#else
9797
return HttpMethod.Post;
9898
#endif
9999
default:
100-
#if NET45
100+
#if NET45_OR_GREATER
101101
return HttpVerbs.Get;
102102
#else
103103
return HttpMethod.Get;

Griddly.Mvc/GriddlyColumn.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Linq.Expressions;
55
using System.Text.RegularExpressions;
66
using System.Web;
7-
#if NET45
7+
#if NET45_OR_GREATER
88
using System.Web.Helpers;
99
using System.Web.Mvc;
1010
using System.Web.Routing;
@@ -66,23 +66,23 @@ string GetIdFromExpression(LambdaExpression expression)
6666
public GriddlyFilter Filter { get; set; }
6767

6868
public abstract HtmlString RenderUnderlyingValue(object row,
69-
#if NET45
69+
#if NET45_OR_GREATER
7070
HtmlHelper html
7171
#else
7272
IHtmlHelper html
7373
#endif
7474
);
7575

7676
public abstract HtmlString RenderCell(object row, GriddlySettings settings,
77-
#if NET45
77+
#if NET45_OR_GREATER
7878
HtmlHelper html,
7979
#else
8080
IHtmlHelper html,
8181
#endif
8282
bool encode = true);
8383

8484
public abstract object RenderCellValue(object row,
85-
#if NET45
85+
#if NET45_OR_GREATER
8686
HttpContextBase httpContext,
8787
#else
8888
HttpContext httpContext,
@@ -100,7 +100,7 @@ public virtual IDictionary<string, object> GenerateHtmlAttributes(object row, Gr
100100
}
101101

102102
public virtual HtmlString RenderValue(object value,
103-
#if NET45
103+
#if NET45_OR_GREATER
104104
HtmlHelper html,
105105
#else
106106
IHtmlHelper html,
@@ -201,7 +201,7 @@ public override IDictionary<string, object> GenerateHtmlAttributes(object row, G
201201
}
202202

203203
public override HtmlString RenderCell(object row, GriddlySettings settings,
204-
#if NET45
204+
#if NET45_OR_GREATER
205205
HtmlHelper html,
206206
#else
207207
IHtmlHelper html,
@@ -251,7 +251,7 @@ public override HtmlString RenderCell(object row, GriddlySettings settings,
251251
}
252252

253253
public override HtmlString RenderUnderlyingValue(object row,
254-
#if NET45
254+
#if NET45_OR_GREATER
255255
HtmlHelper html
256256
#else
257257
IHtmlHelper html
@@ -287,7 +287,7 @@ IHtmlHelper html
287287
}
288288

289289
public override object RenderCellValue(object row,
290-
#if NET45
290+
#if NET45_OR_GREATER
291291
HttpContextBase httpContext,
292292
#else
293293
HttpContext httpContext,

Griddly.Mvc/GriddlyCookieFilterValueProvider.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Linq;
66
using System.Text;
77
using System.Threading.Tasks;
8-
#if NET45
8+
#if NET45_OR_GREATER
99
using System.Web.Mvc;
1010
#else
1111
using Microsoft.AspNetCore.Mvc;
@@ -47,15 +47,15 @@ public ValueProviderResult GetValue(string key)
4747
if (value != null)
4848
attemptedValue = string.Join(",", value);
4949

50-
#if NET45
50+
#if NET45_OR_GREATER
5151
return new ValueProviderResult(value, attemptedValue, CultureInfo.CurrentCulture);
5252
#else
5353
return new ValueProviderResult(value, CultureInfo.CurrentCulture);
5454
#endif
5555
}
5656
}
5757

58-
#if NET45
58+
#if NET45_OR_GREATER
5959
public class GriddlyCookieFilterValueProviderFactory : ValueProviderFactory
6060
{
6161
Func<ControllerContext, bool> _canProvide = (controllerContext) => controllerContext.HttpContext.Request.QueryString.Count == 0;

Griddly.Mvc/GriddlyCsvResult.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
using System.IO;
55
using System.Linq;
66
using System.Threading.Tasks;
7-
#if NET45
7+
using System.Globalization;
8+
#if NET45_OR_GREATER
89
using System.Web.Mvc;
910
#else
1011
using Microsoft.AspNetCore.Mvc;
@@ -29,7 +30,7 @@ public GriddlyCsvResult(IEnumerable<T> data, GriddlySettings settings, string na
2930
_exportName = exportName;
3031
}
3132

32-
#if NET45
33+
#if NET45_OR_GREATER
3334
public override void ExecuteResult(ControllerContext context)
3435
#else
3536
public override async Task ExecuteResultAsync(ActionContext context)
@@ -41,12 +42,12 @@ public override async Task ExecuteResultAsync(ActionContext context)
4142

4243
context.HttpContext.Response.Headers.Add("content-disposition", "attachment; filename=" + _name + "." + format);
4344

44-
#if NET45
45+
#if NET45_OR_GREATER
4546
var tw = context.HttpContext.Response.Output;
4647
#else
4748
using (var tw = new StreamWriter(context.HttpContext.Response.Body))
4849
#endif
49-
using (CsvWriter w = new CsvWriter(tw, new Configuration() { HasHeaderRecord = true, Delimiter = _format == GriddlyExportFormat.Tsv ? "\t" : "," }))
50+
using (CsvWriter w = new CsvWriter(tw, new CsvConfiguration(CultureInfo.CurrentCulture) { HasHeaderRecord = true, Delimiter = _format == GriddlyExportFormat.Tsv ? "\t" : "," }))
5051
{
5152
var export = _settings.Exports.FirstOrDefault(x => x.Name == _exportName);
5253
var columns = export == null ? _settings.Columns : export.Columns;
@@ -71,7 +72,7 @@ public override async Task ExecuteResultAsync(ActionContext context)
7172

7273
w.WriteField(renderedValue);
7374
}
74-
#if NET45
75+
#if NET45_OR_GREATER
7576
w.NextRecord();
7677
#else
7778
await w.NextRecordAsync(); //Fix: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.

Griddly.Mvc/GriddlyExcelResult.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Web;
77
using System.Text.RegularExpressions;
88
using System.Threading.Tasks;
9-
#if NET45
9+
#if NET45_OR_GREATER
1010
using System.Web.Mvc;
1111
#else
1212
using Microsoft.AspNetCore.Mvc;
@@ -34,7 +34,7 @@ public GriddlyExcelResult(IEnumerable<T> data, GriddlySettings settings, string
3434
static readonly Regex _htmlMatch = new Regex(@"<[^>]*>", RegexOptions.Compiled);
3535
// static readonly Regex _aMatch = new Regex(@"<a\s[^>]*\s?href=""(.*?)"">(.*?)</a>", RegexOptions.Compiled | RegexOptions.IgnoreCase);
3636

37-
#if NET45
37+
#if NET45_OR_GREATER
3838
public override void ExecuteResult(ControllerContext context)
3939
#else
4040
public override async Task ExecuteResultAsync(ActionContext context)
@@ -114,7 +114,7 @@ public override async Task ExecuteResultAsync(ActionContext context)
114114
context.HttpContext.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
115115
context.HttpContext.Response.Headers.Add("content-disposition", "attachment; filename=" + _name + ".xlsx");
116116

117-
#if NET45
117+
#if NET45_OR_GREATER
118118
p.SaveAs(context.HttpContext.Response.OutputStream);
119119
#else
120120
var bytes = p.GetAsByteArray();

Griddly.Mvc/GriddlyExport.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Linq;
66
using System.Linq.Expressions;
77
using System.Web;
8-
#if NET45
8+
#if NET45_OR_GREATER
99
using System.Web.Helpers;
1010
using System.Web.Mvc;
1111
using System.Web.Routing;
@@ -19,7 +19,7 @@ namespace Griddly.Mvc
1919
{
2020
public class GriddlyExport
2121
{
22-
#if NET45
22+
#if NET45_OR_GREATER
2323
public GriddlyExport(string name, bool useGridColumns = false)
2424
#else
2525
public GriddlyExport(IHtmlHelper html, string name, bool useGridColumns = false)
@@ -29,20 +29,20 @@ public GriddlyExport(IHtmlHelper html, string name, bool useGridColumns = false)
2929
this.UseGridColumns = useGridColumns;
3030
this.Name = name;
3131
this.Columns = new List<GriddlyColumn>();
32-
#if !NET45
32+
#if !NET45_OR_GREATER
3333
this.Html = html;
3434
#endif
3535
}
3636
public string Name { get; set; }
3737
public bool UseGridColumns { get; set; }
3838
public List<GriddlyColumn> Columns { get; set; }
39-
#if !NET45
39+
#if !NET45_OR_GREATER
4040
public IHtmlHelper Html { get; set; }
4141
#endif
4242
}
4343
public class GriddlyExport<TRow> : GriddlyExport
4444
{
45-
#if NET45
45+
#if NET45_OR_GREATER
4646
public GriddlyExport(string name, bool useGridColumns = false)
4747
: base(name, useGridColumns)
4848
#else
@@ -55,7 +55,7 @@ public GriddlyExport<TRow> Column<TProperty>(Expression<Func<TRow, TProperty>> e
5555
{
5656
if (expression != null)
5757
{
58-
#if NET45
58+
#if NET45_OR_GREATER
5959
ModelMetadata metadata = ModelMetadata.FromLambdaExpression<TRow, TProperty>(expression, new ViewDataDictionary<TRow>());
6060
string htmlFieldName = ExpressionHelper.GetExpressionText(expression);
6161
#else

0 commit comments

Comments
 (0)