Cleanups and xmldoc additions

This commit is contained in:
Dean Herbert 2018-02-15 16:23:34 +09:00
parent 8c1d581fb3
commit 1b13be1372
6 changed files with 21 additions and 16 deletions

View File

@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using osu.Game.Database;
using osu.Game.IO;
namespace osu.Game.Beatmaps
{

View File

@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace osu.Game.Database
{
/// <summary>
/// A model that contains a list of files it is responsible for.
/// </summary>
/// <typeparam name="TFile">The model representing a file.</typeparam>
public interface IHasFiles<TFile>
{
List<TFile> Files { get; set; }
}
}

View File

@ -3,8 +3,14 @@
namespace osu.Game.Database
{
/// <summary>
/// A model that can be deleted from user's view without being instantly lost.
/// </summary>
public interface ISoftDelete
{
/// <summary>
/// Whether this model is marked for future deletion.
/// </summary>
bool DeletePending { get; set; }
}
}

View File

@ -83,11 +83,7 @@ namespace osu.Game.Database
protected virtual IQueryable<T> AddIncludesForDeletion(IQueryable<T> query) => query;
protected virtual void Purge(List<T> items, OsuDbContext context)
{
// cascades down to beatmaps.
context.RemoveRange(items);
}
protected virtual void Purge(List<T> items, OsuDbContext context) => context.RemoveRange(items);
/// <summary>
/// Purge items in a pending delete state.

View File

@ -1,9 +0,0 @@
using System.Collections.Generic;
namespace osu.Game.IO
{
public interface IHasFiles<TFile>
{
List<TFile> Files { get; set; }
}
}

View File

@ -279,6 +279,7 @@
<Compile Include="Database\DatabaseWriteUsage.cs" />
<Compile Include="Database\ICanAcceptFiles.cs" />
<Compile Include="Database\IDatabaseContextFactory.cs" />
<Compile Include="Database\IHasFiles.cs" />
<Compile Include="Database\IHasPrimaryKey.cs" />
<Compile Include="Database\INamedFileInfo.cs" />
<Compile Include="Database\ISoftDelete.cs" />
@ -289,7 +290,6 @@
<Compile Include="IO\Archives\ArchiveReader.cs" />
<Compile Include="IO\Archives\LegacyFilesystemReader.cs" />
<Compile Include="IO\Archives\ZipArchiveReader.cs" />
<Compile Include="IO\IHasFiles.cs" />
<Compile Include="Online\API\APIDownloadRequest.cs" />
<Compile Include="Online\API\Requests\GetUserRequest.cs" />
<Compile Include="Migrations\20180125143340_Settings.cs" />