Skip to content

Commit f319bf9

Browse files
committed
Sealing classes
1 parent 1dc1909 commit f319bf9

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

src/LinkDotNet.Blog.Infrastructure/PagedList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace LinkDotNet.Blog.Infrastructure;
77

8-
public class PagedList<T> : IPagedList<T>
8+
public sealed class PagedList<T> : IPagedList<T>
99
{
1010
public static readonly PagedList<T> Empty = new(Enumerable.Empty<T>(), 0, 0, 0);
1111

src/LinkDotNet.Blog.Infrastructure/Persistence/InMemory/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace LinkDotNet.Blog.Infrastructure.Persistence.InMemory;
99

10-
public class Repository<TEntity> : IRepository<TEntity>
10+
public sealed class Repository<TEntity> : IRepository<TEntity>
1111
where TEntity : Entity
1212
{
1313
private readonly List<TEntity> entities = new();

src/LinkDotNet.Blog.Infrastructure/Persistence/RavenDb/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace LinkDotNet.Blog.Infrastructure.Persistence.RavenDb;
99

10-
public class Repository<TEntity> : IRepository<TEntity>
10+
public sealed class Repository<TEntity> : IRepository<TEntity>
1111
where TEntity : Entity
1212
{
1313
private readonly IDocumentStore documentStore;

src/LinkDotNet.Blog.Infrastructure/Persistence/Sql/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace LinkDotNet.Blog.Infrastructure.Persistence.Sql;
99

10-
public class Repository<TEntity> : IRepository<TEntity>
10+
public sealed class Repository<TEntity> : IRepository<TEntity>
1111
where TEntity : Entity
1212
{
1313
private readonly IDbContextFactory<BlogDbContext> dbContextFactory;

src/LinkDotNet.Blog.Web/RegistrationExtensions/SqlRegistrationExtensions.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using LinkDotNet.Blog.Infrastructure.Persistence;
1+
using LinkDotNet.Blog.Infrastructure.Persistence;
32
using LinkDotNet.Blog.Infrastructure.Persistence.Sql;
43
using Microsoft.EntityFrameworkCore;
54
using Microsoft.Extensions.DependencyInjection;
@@ -17,7 +16,11 @@ public static void UseSqlAsStorageProvider(this IServiceCollection services)
1716
{
1817
var configuration = s.GetRequiredService<AppConfiguration>();
1918
var connectionString = configuration.ConnectionString;
20-
builder.UseSqlServer(connectionString);
19+
builder.UseSqlServer(connectionString)
20+
#if DEBUG
21+
.EnableDetailedErrors()
22+
#endif
23+
;
2124
});
2225

2326
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
@@ -32,8 +35,12 @@ public static void UseSqliteAsStorageProvider(this IServiceCollection services)
3235
{
3336
var configuration = s.GetRequiredService<AppConfiguration>();
3437
var connectionString = configuration.ConnectionString;
35-
builder.UseSqlite(connectionString);
38+
builder.UseSqlite(connectionString)
39+
#if DEBUG
40+
.EnableDetailedErrors()
41+
#endif
42+
;
3643
});
3744
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
3845
}
39-
}
46+
}

0 commit comments

Comments
 (0)