Skip to content

Commit ed45902

Browse files
committed
Removed unnecessary compiler directives.
1 parent b8ebe3c commit ed45902

File tree

5 files changed

+2
-14
lines changed

5 files changed

+2
-14
lines changed

samples/Thinktecture.Runtime.Extensions.EntityFrameworkCore.Samples/ProductsDbContext.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ namespace Thinktecture;
44

55
public class ProductsDbContext : DbContext
66
{
7-
#nullable disable
8-
public DbSet<Product> Products { get; set; }
9-
#nullable enable
7+
public DbSet<Product> Products => Set<Product>();
108

119
public ProductsDbContext(DbContextOptions<ProductsDbContext> options)
1210
: base(options)

src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/StructValueObjectMessagePackFormatter.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ public void Serialize(ref MessagePackWriter writer, T? value, MessagePackSeriali
3737
}
3838

3939
/// <inheritdoc />
40-
#pragma warning disable CS8766
4140
public T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
42-
#pragma warning restore CS8766
4341
{
4442
if (!TryReadKey(ref reader, options, out var key))
4543
return default;
@@ -48,9 +46,7 @@ public T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions
4846
}
4947

5048
/// <inheritdoc />
51-
#pragma warning disable CS8766
5249
T? IMessagePackFormatter<T?>.Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
53-
#pragma warning restore CS8766
5450
{
5551
if (!TryReadKey(ref reader, options, out var key))
5652
return default;

src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/ValueObjectMessagePackFormatter.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Thinktecture.Formatters;
99
/// </summary>
1010
/// <typeparam name="T">Type of the value object.</typeparam>
1111
/// <typeparam name="TKey">Type of the key.</typeparam>
12-
public sealed class ValueObjectMessagePackFormatter<T, TKey> : IMessagePackFormatter<T>
12+
public sealed class ValueObjectMessagePackFormatter<T, TKey> : IMessagePackFormatter<T?>
1313
where T : class, IKeyedValueObject<T, TKey>
1414
where TKey : notnull
1515
{
@@ -30,9 +30,7 @@ public void Serialize(ref MessagePackWriter writer, T? value, MessagePackSeriali
3030
}
3131

3232
/// <inheritdoc />
33-
#pragma warning disable CS8766
3433
public T? Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
35-
#pragma warning restore CS8766
3634
{
3735
if (reader.TryReadNil())
3836
return default;

src/Thinktecture.Runtime.Extensions/Collections/ReadOnlyDictionary.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ public bool ContainsKey(TKey key)
1818
return false;
1919
}
2020

21-
#pragma warning disable CS8767
2221
public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
23-
#pragma warning restore CS8767
2422
{
2523
value = default;
2624
return false;

src/Thinktecture.Runtime.Extensions/Collections/SingleItemReadOnlyDictionary.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ public SingleItemReadOnlyDictionary(TKey key, TValue value, IEqualityComparer<TK
2323
_equalityComparer = equalityComparer ?? EqualityComparer<TKey>.Default;
2424
}
2525

26-
#pragma warning disable CS8767
2726
public bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
28-
#pragma warning restore CS8767
2927
{
3028
if (_equalityComparer.Equals(_key, key))
3129
{

0 commit comments

Comments
 (0)