Skip to content

Commit b265e08

Browse files
committed
Enable nullable and improve source generators
1 parent af96d32 commit b265e08

File tree

116 files changed

+2766
-1089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+2766
-1089
lines changed

src/FluentCommand.Caching/DistributedDataCache.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public DistributedDataCache(ILogger<DistributedDataCache> logger, IDistributedCa
4141
/// <para>Value is the cache entry that is identified by key</para>
4242
/// </returns>
4343
/// <exception cref="System.ArgumentException">key cannot be null or empty. - key</exception>
44-
public (bool Success, T Value) Get<T>(string key)
44+
public (bool Success, T? Value) Get<T>(string key)
4545
{
4646
if (string.IsNullOrEmpty(key))
4747
throw new ArgumentException($"'{nameof(key)}' cannot be null or empty.", nameof(key));
@@ -72,7 +72,7 @@ public DistributedDataCache(ILogger<DistributedDataCache> logger, IDistributedCa
7272
/// <para>Value is the cache entry that is identified by key</para>
7373
/// </returns>
7474
/// <exception cref="System.ArgumentException">'key' cannot be null or empty. - key</exception>
75-
public async Task<(bool Success, T Value)> GetAsync<T>(string key, CancellationToken cancellationToken = default)
75+
public async Task<(bool Success, T? Value)> GetAsync<T>(string key, CancellationToken cancellationToken = default)
7676
{
7777
if (string.IsNullOrEmpty(key))
7878
throw new ArgumentException($"'{nameof(key)}' cannot be null or empty.", nameof(key));

src/FluentCommand.Caching/FluentCommand.Caching.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
46
<Description>Fluent Wrapper for DbCommand with distributed caching support using Microsoft.Extensions.Caching and MessagePack serialization</Description>
57
</PropertyGroup>
68
<ItemGroup>

src/FluentCommand.Caching/MessagePackCacheSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class MessagePackCacheSerializer : IDistributedCacheSerializer
1515
/// Initializes a new instance of the <see cref="MessagePackCacheSerializer"/> class.
1616
/// </summary>
1717
/// <param name="messagePackSerializerOptions">The message pack serializer options.</param>
18-
public MessagePackCacheSerializer(MessagePackSerializerOptions messagePackSerializerOptions = null)
18+
public MessagePackCacheSerializer(MessagePackSerializerOptions? messagePackSerializerOptions = null)
1919
{
2020
_messagePackSerializerOptions = messagePackSerializerOptions
2121
?? ContractlessStandardResolver.Options.WithCompression(MessagePackCompression.Lz4BlockArray);

src/FluentCommand.Csv/CsvCommandExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ await dataCommand.ReadAsync(
134134
private static void WriteData(TextWriter writer, IDataReader reader)
135135
{
136136
var wroteHeader = false;
137-
Type[] rowTypes = null;
137+
Type[]? rowTypes = null;
138138

139139
while (reader.Read())
140140
{
@@ -158,7 +158,7 @@ private static void WriteData(TextWriter writer, IDataReader reader)
158158
private static async Task WriteDataAsync(TextWriter writer, DbDataReader reader, CancellationToken cancellationToken = default)
159159
{
160160
var wroteHeader = false;
161-
Type[] rowTypes = null;
161+
Type[]? rowTypes = null;
162162

163163
while (await reader.ReadAsync(cancellationToken))
164164
{
@@ -367,7 +367,7 @@ private static void WriteValue(TextWriter writer, IDataReader reader, int index,
367367
WriteValue(writer, formattedValue);
368368
}
369369

370-
private static void WriteValue(TextWriter writer, string value)
370+
private static void WriteValue(TextWriter writer, string? value)
371371
{
372372
if (string.IsNullOrEmpty(value))
373373
return;

src/FluentCommand.Csv/FluentCommand.Csv.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<PropertyGroup>
33
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
44
<RootNamespace>FluentCommand</RootNamespace>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
57
<Description>Fluent Wrapper for DbCommand with CSV export support for query results</Description>
68
</PropertyGroup>
79
<ItemGroup>

0 commit comments

Comments
 (0)