Skip to content

Commit

Permalink
refactor(core): mark FileManager and DataContext as sealed
Browse files Browse the repository at this point in the history
Both of the classes are not meant to be overriden, so make it explicit by marking them as sealed.
  • Loading branch information
codingawayy committed Jan 6, 2024
1 parent 491734b commit f5256d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Filer.EntityFrameworkCore/DataContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Filer.EntityFrameworkCore
/// <summary>
/// Represents a single unit of work.
/// </summary>
public class DataContext : IDisposable
public sealed class DataContext : IDisposable
{
/// <summary>
/// Instantiates a new instance of the DataContext class.
Expand All @@ -28,8 +28,6 @@ public void Dispose()
this.DbContext.Dispose();
this.DbContext = null;
}

GC.SuppressFinalize(this);
}

/// <summary>
Expand Down
5 changes: 2 additions & 3 deletions Filer.EntityFrameworkCore/FileManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Filer.EntityFrameworkCore
namespace Filer.EntityFrameworkCore
{
using System;
using System.Collections.Generic;
Expand All @@ -14,7 +14,7 @@
/// <summary>
/// Manages files in the FileStore repository.
/// </summary>
public class FileManager : IFileManager
public sealed class FileManager : IFileManager
{
private readonly FileStoreContext dbContext;

Expand Down Expand Up @@ -241,7 +241,6 @@ public async Task DetachFileFromContextsAsync(int fileId, params string[] contex
public void Dispose()
{
this.dbContext?.Dispose();
GC.SuppressFinalize(this);
}

/// <inheritdoc />
Expand Down

0 comments on commit f5256d7

Please sign in to comment.