Skip to content

Commit c15e14e

Browse files
committed
Downgrade lang version
1 parent e763cd0 commit c15e14e

File tree

8 files changed

+40
-47
lines changed

8 files changed

+40
-47
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup .NET Core
1515
uses: actions/setup-dotnet@v1
1616
with:
17-
dotnet-version: 7.0.x
17+
dotnet-version: 6.0.x
1818
- name: Install dependencies
1919
working-directory: ${{env.working-directory}}
2020
run: dotnet restore

src/Codehard.Functional/Codehard.Functional.AspNetCore/Codehard.Functional.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
6-
<LangVersion>11.0</LangVersion>
6+
<LangVersion>10.0</LangVersion>
77
<Nullable>enable</Nullable>
88
<Version>2.5.2</Version>
99
<Description>A library contains common code related to functional programming in ASP.NET Core based on LanguageExt.</Description>

src/Codehard.Functional/Codehard.Functional.AspNetCore/Sources/CommonSource.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ internal static class CommonSource
99
public static string Generate()
1010
{
1111
const string code =
12-
"""
13-
// <auto-generated />
12+
13+
@"// <auto-generated />
1414
using System.Net;
1515
using LanguageExt;
1616
using LanguageExt.Common;
@@ -109,8 +109,7 @@ internal static Eff<A> MapFailToHttpResultError<A>(
109109
err),
110110
};
111111
});
112-
}
113-
""";
112+
}";
114113

115114
return code.Replace("@namespace", Constants.Namespace);
116115
}

src/Codehard.Functional/Codehard.Functional.AspNetCore/Sources/ControllerSource.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ internal static class ControllerSource
99
public static string Generate()
1010
{
1111
const string code =
12-
"""
13-
// <auto-generated />
12+
@"// <auto-generated />
1413
using System.Net;
1514
using Codehard.Functional.Logger;
1615
using LanguageExt;
@@ -53,13 +52,13 @@ private static IActionResult MapErrorToActionResult(Error err)
5352
}
5453
5554
/// <summary>
56-
/// Matches a Fin of <typeparamref name="T"/> into an <see cref="IActionResult"/>.
55+
/// Matches a Fin of <typeparamref name=""T""/> into an <see cref=""IActionResult""/>.
5756
/// </summary>
58-
/// <typeparam name="T">The type of the successful result.</typeparam>
59-
/// <param name="fin">The <see cref="Fin{T}"/> to match.</param>
60-
/// <param name="successStatusCode">The HTTP status code to return on success.</param>
61-
/// <param name="logger">An optional <see cref="ILogger"/> instance used for logging.</param>
62-
/// <returns>An <see cref="IActionResult"/> that represents the result of matching <paramref name="fin"/>.</returns>
57+
/// <typeparam name=""T"">The type of the successful result.</typeparam>
58+
/// <param name=""fin"">The <see cref=""Fin{T}""/> to match.</param>
59+
/// <param name=""successStatusCode"">The HTTP status code to return on success.</param>
60+
/// <param name=""logger"">An optional <see cref=""ILogger""/> instance used for logging.</param>
61+
/// <returns>An <see cref=""IActionResult""/> that represents the result of matching <paramref name=""fin""/>.</returns>
6362
public static IActionResult MatchToResult<T>(
6463
this Fin<T> fin,
6564
HttpStatusCode successStatusCode = HttpStatusCode.OK,
@@ -83,7 +82,7 @@ public static IActionResult MatchToResult<T>(
8382
}
8483
8584
/// <summary>
86-
/// Match a Fin of Option <typeparamref name="T"/> into IActionResult.
85+
/// Match a Fin of Option <typeparamref name=""T""/> into IActionResult.
8786
/// When option is none the NotFound status is returned.
8887
/// </summary>
8988
public static IActionResult MatchToResult<T>(
@@ -114,10 +113,10 @@ public static IActionResult MatchToResult<T>(
114113
/// <summary>
115114
/// Run the async effect into IActionResult in an asynchronous manner.
116115
/// </summary>
117-
/// <param name="aff"></param>
118-
/// <param name="successStatusCode"></param>
119-
/// <param name="logger"></param>
120-
/// <typeparam name="T"></typeparam>
116+
/// <param name=""aff""></param>
117+
/// <param name=""successStatusCode""></param>
118+
/// <param name=""logger""></param>
119+
/// <typeparam name=""T""></typeparam>
121120
/// <returns></returns>
122121
public static ValueTask<IActionResult> RunToResultAsync<T>(
123122
this Aff<T> aff,
@@ -146,8 +145,7 @@ public static IActionResult RunToResult<T>(
146145
successStatusCode: successStatusCode,
147146
logger: logger);
148147
}
149-
}
150-
""";
148+
}";
151149

152150
return code.Replace("@namespace", Constants.Namespace);
153151
}

src/Codehard.Functional/Codehard.Functional.AspNetCore/Sources/ErrorWrapperActionResultSource.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,44 @@ internal static class ErrorWrapperActionResultSource
99
public static string Generate()
1010
{
1111
const string code =
12-
"""
13-
// <auto-generated />
12+
@"// <auto-generated />
1413
using System.Dynamic;
1514
using Microsoft.AspNetCore.Mvc;
1615
1716
namespace @namespace;
1817
1918
/// <summary>
20-
/// An <see cref="IActionResult"/> that wraps an <see cref="HttpResultError"/> object and
19+
/// An <see cref=""IActionResult""/> that wraps an <see cref=""HttpResultError""/> object and
2120
/// returns it as a result, including additional error information in the response body.
2221
/// </summary>
2322
public class ErrorWrapperActionResult : IActionResult
2423
{
2524
/// <summary>
26-
/// Gets the <see cref="HttpResultError"/> object that is being wrapped by this action result.
25+
/// Gets the <see cref=""HttpResultError""/> object that is being wrapped by this action result.
2726
/// </summary>
2827
public HttpResultError Error { get; }
2928
3029
/// <summary>
31-
/// Initializes a new instance of the <see cref="ErrorWrapperActionResult"/> class with the
32-
/// specified <see cref="HttpResultError"/> object.
30+
/// Initializes a new instance of the <see cref=""ErrorWrapperActionResult""/> class with the
31+
/// specified <see cref=""HttpResultError""/> object.
3332
/// </summary>
34-
/// <param name="error">The <see cref="HttpResultError"/> object to be returned as the result of the action.</param>
35-
/// <exception cref="ArgumentNullException">Thrown if the <paramref name="error"/> parameter is <c>null</c>.</exception>
33+
/// <param name=""error"">The <see cref=""HttpResultError""/> object to be returned as the result of the action.</param>
34+
/// <exception cref=""ArgumentNullException"">Thrown if the <paramref name=""error""/> parameter is <c>null</c>.</exception>
3635
public ErrorWrapperActionResult(HttpResultError error)
3736
{
3837
this.Error = error ?? throw new ArgumentNullException(nameof(error));
3938
}
4039
4140
/// <summary>
4241
/// Executes the result of the action by setting the response headers and body based on the
43-
/// <see cref="HttpResultError"/> object being wrapped.
42+
/// <see cref=""HttpResultError""/> object being wrapped.
4443
/// </summary>
45-
/// <param name="context">The context in which the result is executed.</param>
46-
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
44+
/// <param name=""context"">The context in which the result is executed.</param>
45+
/// <returns>A <see cref=""Task""/> representing the asynchronous operation.</returns>
4746
public async Task ExecuteResultAsync(ActionContext context)
4847
{
4948
this.Error.ErrorCode.IfSome(errCode =>
50-
context.HttpContext.Response.Headers.Add("x-error-code", errCode));
49+
context.HttpContext.Response.Headers.Add(""x-error-code"", errCode));
5150
5251
await this.Error.Data
5352
.Map(
@@ -93,7 +92,7 @@ ObjectResult AddErrorInfo(ObjectResult objectResult)
9392
}
9493
}
9594
96-
expando["ErrorInfo"] =
95+
expando[""ErrorInfo""] =
9796
new
9897
{
9998
ErrorCode = this.Error.ErrorCode.IfNoneUnsafe(default(string)),
@@ -106,8 +105,7 @@ ObjectResult AddErrorInfo(ObjectResult objectResult)
106105
};
107106
}
108107
}
109-
}
110-
""";
108+
}";
111109

112110
return code.Replace("@namespace", Constants.Namespace);
113111
}

src/Codehard.Functional/Codehard.Functional.AspNetCore/Sources/HttpResultErrorSource.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ internal static class HttpResultErrorSource
99
public static string Generate()
1010
{
1111
const string code =
12-
"""
13-
using System.Net;
12+
@"using System.Net;
1413
using System.Runtime.Serialization;
1514
using LanguageExt;
1615
using LanguageExt.Common;
@@ -109,11 +108,11 @@ public override ErrorException ToErrorException() =>
109108
/// <summary>
110109
/// Create an 'HttpResultError' error.
111110
/// </summary>
112-
/// <param name="statusCode"></param>
113-
/// <param name="message"></param>
114-
/// <param name="errorCode"></param>
115-
/// <param name="data"></param>
116-
/// <param name="error"></param>
111+
/// <param name=""statusCode""></param>
112+
/// <param name=""message""></param>
113+
/// <param name=""errorCode""></param>
114+
/// <param name=""data""></param>
115+
/// <param name=""error""></param>
117116
/// <returns></returns>
118117
public static HttpResultError New(
119118
HttpStatusCode statusCode,
@@ -130,8 +129,7 @@ public static HttpResultError New(
130129
data,
131130
error);
132131
}
133-
}
134-
""";
132+
}";
135133

136134
return code.Replace("@namespace", Constants.Namespace);
137135
}

src/Codehard.Functional/Codehard.Functional.Logger/Codehard.Functional.Logger.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
6-
<LangVersion>11.0</LangVersion>
6+
<LangVersion>10.0</LangVersion>
77
<Nullable>enable</Nullable>
88
<Version>2.5.0</Version>
99
<Description>A library contains common code related to functional programming with logger based on LanguageExt.</Description>

src/Codehard.Functional/Codehard.Functional/Codehard.Functional.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
6-
<LangVersion>11.0</LangVersion>
6+
<LangVersion>10.0</LangVersion>
77
<Nullable>enable</Nullable>
88
<Version>2.5.3</Version>
99
<Description>A library contains common code related to functional programming based on LanguageExt.</Description>

0 commit comments

Comments
 (0)