< Summary - ZhEaIsNsAaBn.Libraries coverage (affected: 23 packages)

Information
Class: Microsoft.EntityFrameworkCore.EfExceptions
Assembly: ZhEaIsNsAaBn.Infrastructure.Core
File(s): /home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Core/Errors/EfExceptions.cs
Line coverage
45%
Covered lines: 5
Uncovered lines: 6
Coverable lines: 11
Total lines: 52
Line coverage: 45.4%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ConcurrencyException(...)100%11100%
CouldNotTruncate(...)100%210%
UpdateException(...)100%210%
TransactionAlreadyStarted()100%11100%
NoActiveTransaction()100%11100%
ValidationException(...)100%210%

File(s)

/home/runner/work/ZhEaIsNsAaBn.Libraries.V1/ZhEaIsNsAaBn.Libraries.V1/src/DataBasePackages/ZhEaIsNsAaBn.Infrastructure.Core/Errors/EfExceptions.cs

#LineLine coverage
 1// ReSharper disable once CheckNamespace
 2namespace Microsoft.EntityFrameworkCore;
 3
 4/// <summary>Errors raised by EF Core itself rather than by SQL Server. Type: <c>DatabaseError</c>.</summary>
 5public static class EfExceptions
 6{
 7    private const string DatabaseError = nameof( DatabaseError );
 8
 9
 10    /// <summary>The row changed (or was deleted) since it was read, so the save was rejected.</summary>
 11    /// <param name="exception">The exception, kept for logs.</param>
 12    /// <param name="additionalData">Extra values for logs, e.g. the entity names involved.</param>
 13    /// <returns>The <c>ConcurrencyException</c> error (severity Medium).</returns>
 14    public static Error ConcurrencyException( DbUpdateConcurrencyException exception, IReadOnlyDictionary<string, object
 1015        => new( nameof( ConcurrencyException ), DatabaseError, "لم يتم حفظ التغييرات بسبب تعديلات من مستخدم آخر، يرجى تح
 1016                "The changes couldn't be saved due to modifications by another user; please refresh and retry", Severity
 1017                additionalData );
 18
 19    /// <summary>A table couldn't be truncated.</summary>
 20    /// <param name="exception">The exception, kept for logs.</param>
 21    /// <param name="additionalData">Extra values for logs.</param>
 22    /// <returns>The <c>CouldNotTruncate</c> error (severity Medium).</returns>
 23    public static Error CouldNotTruncate( DbUpdateConcurrencyException exception, IReadOnlyDictionary<string, object>? a
 024        => new( nameof( CouldNotTruncate ), DatabaseError, "تعذر تفريغ الجدول.", "The table couldn't be truncated.", Sev
 025                additionalData );
 26
 27    /// <summary>The changes couldn't be saved to the database.</summary>
 28    /// <param name="exception">The exception, kept for logs.</param>
 29    /// <param name="additionalData">Extra values for logs.</param>
 30    /// <returns>The <c>UpdateException</c> error (severity Medium).</returns>
 31    public static Error UpdateException( DbUpdateConcurrencyException exception, IReadOnlyDictionary<string, object>? ad
 032        => new( nameof( UpdateException ), DatabaseError, "لم يتم حفظ التغييرات في قاعدة البيانات.", "The changes couldn
 033                Severity.Medium, exception, additionalData );
 34
 35    /// <summary>A transaction was started while another one is still open on the same context.</summary>
 36    /// <returns>The <c>TransactionAlreadyStarted</c> error (severity Medium).</returns>
 37    public static Error TransactionAlreadyStarted()
 438        => new( nameof( TransactionAlreadyStarted ), DatabaseError, "توجد معاملة مفتوحة بالفعل.", "A transaction is alre
 39
 40    /// <summary>Commit or rollback was called with no open transaction.</summary>
 41    /// <returns>The <c>NoActiveTransaction</c> error (severity Medium).</returns>
 42    public static Error NoActiveTransaction()
 843        => new( nameof( NoActiveTransaction ), DatabaseError, "لا توجد معاملة مفتوحة.", "There is no open transaction.",
 44
 45    /// <summary>Some values didn't meet the rules required for saving.</summary>
 46    /// <param name="exception">The exception, kept for logs.</param>
 47    /// <param name="additionalData">Extra values for logs.</param>
 48    /// <returns>The <c>ValidationException</c> error (severity Medium).</returns>
 49    public static Error ValidationException( DbUpdateConcurrencyException exception, IReadOnlyDictionary<string, object>
 050        => new( nameof( ValidationException ), DatabaseError, "لم يتم حفظ التغييرات لأن بعض البيانات لم تستوفِ الشروط ال
 051                "The changes couldn't be saved because some data didn't meet the required rules.", Severity.Medium, exce
 52}