< Summary

Information
Class: Api.Files.Models.FileRecord
Assembly: Api
File(s): /home/runner/work/ProjectRead.ing/ProjectRead.ing/Api/Files/Models/FileRecord.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 52
Line coverage: 100%
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
get_IdPostfix()100%11100%
.ctor()100%11100%

File(s)

/home/runner/work/ProjectRead.ing/ProjectRead.ing/Api/Files/Models/FileRecord.cs

#LineLine coverage
 1// SPDX-FileCopyrightText: 2026 Alper Çelik <alper@alper-celik.dev>
 2//
 3// SPDX-License-Identifier: AGPL-3.0-or-later
 4
 5using System.ComponentModel.DataAnnotations;
 6using System.ComponentModel.DataAnnotations.Schema;
 7using Microsoft.EntityFrameworkCore;
 8// Mostly Ai Generated - Start
 9using Riok.Mapperly.Abstractions;
 10
 11// Mostly Ai Generated - End
 12
 13namespace Api.Files.Models;
 14
 15[Table("file_records")]
 16[Index(nameof(OwnerId), nameof(FileKind))]
 17// Mostly Ai Generated - Start
 18public class FileRecord : IDbEntityMetadata
 19// Mostly Ai Generated - End
 20{
 121    public static byte IdPostfix => (byte)IdPostfixes.FileRecord;
 22
 23    [Key]
 24    public Guid Id { get; set; }
 25    public int RowVersion { get; set; }
 26    public NodaTime.Instant MetadataAddedAt { get; set; }
 27    public NodaTime.Instant MetadataUpdatedAt { get; set; }
 28
 29    // Mostly Ai Generated - Start
 30    [MapperIgnore]
 31    // Mostly Ai Generated - End
 32    public Guid OwnerId { get; set; }
 33
 34    public FileKind FileKind { get; set; }
 35
 36    [ForeignKey(nameof(FileProviderBackendConfig))]
 37    public required Guid FileProviderBackendConfigId { get; set; }
 38
 139    public bool Uploaded { get; set; } = false;
 40
 41    [MaxLength(1000)]
 42    public string? OriginalFileName { get; set; }
 43    public required string ContentType { get; set; }
 44    public long SizeBytes { get; set; }
 45    public required byte[] SHA256 { get; set; }
 46
 47    //Navigation properties
 48    // Mostly Ai Generated - Start
 49    [MapperIgnore]
 50    // Mostly Ai Generated - End
 151    public FileProviderBackendConfig FileProviderBackendConfig { get; set; } = null!;
 52}

Methods/Properties

get_IdPostfix()
.ctor()