Skip to content

Commit

Permalink
refactor: initialize with null!
Browse files Browse the repository at this point in the history
refactor: remove nullable operator from setupOptions
  • Loading branch information
NikolaDmitrasinovic committed Jan 25, 2024
1 parent c72b055 commit 099dc71
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static class IServiceCollectionExtensions
public static void AddDatabase(this IServiceCollection services, Action<DbOptions> setupOptions)
{
var options = new DbOptions();
setupOptions?.Invoke(options);
setupOptions.Invoke(options);

services.AddDatabase(options);
}
Expand Down Expand Up @@ -65,8 +65,8 @@ public static void AddDatabase(this IServiceCollection services, DbOptions optio

public class DbOptions
{
public string? Provider { get; set; }
public string? DbConnectionString { get; set; }
public string Provider { get; set; } = null!;
public string DbConnectionString { get; set; } = null!;
public RetryOptions RetryOptions { get; set; } = new();
}

Expand Down

0 comments on commit 099dc71

Please sign in to comment.