1
0
mirror of https://github.com/bitwarden/server synced 2025-12-20 18:23:44 +00:00

Tools - Make Entities and Repositories nullable (#3313)

* support nullability in tools' entities and repositories

* enables C# nullability checks in these files
* includes documentation for affected files

* refine documentation per code review

* improve comments on SendFileData structure

* fix ReferenceEvent.MaxAccessCount documentation

* add value notation to SendFileData.FileName
This commit is contained in:
✨ Audrey ✨
2023-11-22 15:44:25 -05:00
committed by GitHub
parent 8e5598a1dd
commit 98c12d3f41
9 changed files with 447 additions and 29 deletions

View File

@@ -1,4 +1,6 @@
using System.Data;
#nullable enable
using System.Data;
using Bit.Core.Settings;
using Bit.Core.Tools.Entities;
using Bit.Core.Tools.Repositories;
@@ -8,6 +10,7 @@ using Microsoft.Data.SqlClient;
namespace Bit.Infrastructure.Dapper.Tools.Repositories;
/// <inheritdoc cref="ISendRepository" />
public class SendRepository : Repository<Send, Guid>, ISendRepository
{
public SendRepository(GlobalSettings globalSettings)
@@ -18,6 +21,7 @@ public class SendRepository : Repository<Send, Guid>, ISendRepository
: base(connectionString, readOnlyConnectionString)
{ }
/// <inheritdoc />
public async Task<ICollection<Send>> GetManyByUserIdAsync(Guid userId)
{
using (var connection = new SqlConnection(ConnectionString))
@@ -31,6 +35,7 @@ public class SendRepository : Repository<Send, Guid>, ISendRepository
}
}
/// <inheritdoc />
public async Task<ICollection<Send>> GetManyByDeletionDateAsync(DateTime deletionDateBefore)
{
using (var connection = new SqlConnection(ConnectionString))