Skip to content

Commit ce5f774

Browse files
committed
netstandard für rona...
1 parent 7a6360c commit ce5f774

File tree

7 files changed

+22
-11
lines changed

7 files changed

+22
-11
lines changed

src/Common/src/Common.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<DocumentationFile>$(ArtifactsPath)\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
99
<Description>This project contains general, framework independent utilities and abstractions.</Description>
1010
<PackageReadmeFile>README.md</PackageReadmeFile>
11+
<TargetFramework>netstandard2.0</TargetFramework>
1112
</PropertyGroup>
1213

1314
<ItemGroup>

src/Common/src/Reflection/PropertyUtil.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,26 @@ public static class PropertyUtil
1111
/// <summary> Returns the name of the property used in the given expression. </summary>
1212
public static string GetName<T, TResult>(Expression<Func<T, TResult>> propertyExpression)
1313
{
14-
ArgumentNullException.ThrowIfNull(propertyExpression);
14+
if (propertyExpression == null)
15+
throw new ArgumentNullException(nameof(propertyExpression));
1516

1617
return GetPropertyMember(propertyExpression.Body).Name;
1718
}
1819

1920
/// <summary> Returns the name of the property used in the given expression. </summary>
2021
public static string GetName<T>(Expression<Func<T, object>> propertyExpression)
2122
{
22-
ArgumentNullException.ThrowIfNull(propertyExpression);
23+
if (propertyExpression == null)
24+
throw new ArgumentNullException(nameof(propertyExpression));
2325

2426
return GetPropertyMember(propertyExpression.Body).Name;
2527
}
2628

2729
/// <summary> Returns the type of the property used in the given expression. </summary>
2830
public static Type GetType<T>(Expression<Func<T, object>> propertyExpression)
2931
{
30-
ArgumentNullException.ThrowIfNull(propertyExpression);
32+
if (propertyExpression == null)
33+
throw new ArgumentNullException(nameof(propertyExpression));
3134

3235
var propertyMember = GetPropertyMember(propertyExpression.Body);
3336
return propertyMember.DeclaringType!.GetProperty(propertyMember.Name)!.PropertyType;

src/Common/src/Security/IUserAccessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Fusonic GmbH. All rights reserved.
1+
// Copyright (c) Fusonic GmbH. All rights reserved.
22
// Licensed under the MIT License. See LICENSE file in the project root for license information.
33

44
using System.Diagnostics.CodeAnalysis;
@@ -16,5 +16,5 @@ public interface IUserAccessor
1616
/// <summary> Tries to get the current user.</summary>
1717
/// <param name="user">The retrieved user.</param>
1818
/// <returns><c>true</c> if a user is avilable. Otherwise <c>false</c>.</returns>
19-
bool TryGetUser([MaybeNullWhen(false)] out ClaimsPrincipal user);
19+
bool TryGetUser(out ClaimsPrincipal user);
2020
}

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>10.0.0-rc.1</Version>
3+
<Version>10.0.0-netstandard.1</Version>
44
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

src/Mediator/src/DependencyInjection/ServiceProviderMediator.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Collections.Concurrent;
55
using System.Runtime.CompilerServices;
6+
using System.Threading;
67

78
namespace Fusonic.Extensions.Mediator.DependencyInjection;
89

@@ -14,7 +15,8 @@ public class ServiceProviderMediator(IServiceProvider serviceProvider) : IMediat
1415

1516
public async Task<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default)
1617
{
17-
ArgumentNullException.ThrowIfNull(request);
18+
if (request == null)
19+
throw new ArgumentNullException(nameof(request));
1820

1921
var wrapper = RequestWrappers.GetOrAdd(request.GetType(),
2022
t =>
@@ -29,9 +31,13 @@ public async Task<TResponse> Send<TResponse>(IRequest<TResponse> request, Cancel
2931
return (TResponse)await wrapper.Handle(request, serviceProvider, cancellationToken);
3032
}
3133

34+
public async Task Send(IRequest request, CancellationToken cancellationToken = default)
35+
=> await Send<Unit>(request, cancellationToken);
36+
3237
public async Task Publish(INotification notification, CancellationToken cancellationToken = default)
3338
{
34-
ArgumentNullException.ThrowIfNull(notification);
39+
if (notification == null)
40+
throw new ArgumentNullException(nameof(notification));
3541

3642
var wrapper = NotificationWrappers.GetOrAdd(notification.GetType(),
3743
t =>
@@ -48,7 +54,8 @@ public async Task Publish(INotification notification, CancellationToken cancella
4854

4955
public async IAsyncEnumerable<TResponse> CreateAsyncEnumerable<TResponse>(IAsyncEnumerableRequest<TResponse> request, [EnumeratorCancellation] CancellationToken cancellationToken = default)
5056
{
51-
ArgumentNullException.ThrowIfNull(request);
57+
if (request == null)
58+
throw new ArgumentNullException(nameof(request));
5259

5360
var wrapper = AsyncEnumWrappers.GetOrAdd(request.GetType(),
5461
t =>

src/Mediator/src/ISender.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public interface ISender
2323
/// <param name="request">Request object</param>
2424
/// <param name="cancellationToken">Optional cancellation token</param>
2525
/// <returns></returns>
26-
async Task Send(IRequest request, CancellationToken cancellationToken = default)
27-
=> await Send<Unit>(request, cancellationToken);
26+
Task Send(IRequest request, CancellationToken cancellationToken = default);
2827

2928
/// <summary>
3029
/// Create a stream via a single stream handler

src/Mediator/src/Mediator.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<DocumentationFile>$(ArtifactsPath)\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
99
<Description>Contains a simple implementation of the common mediator pattern. </Description>
1010
<PackageReadmeFile>README.md</PackageReadmeFile>
11+
<TargetFramework>netstandard2.0</TargetFramework>
1112
</PropertyGroup>
1213

1314
<ItemGroup>

0 commit comments

Comments
 (0)