Achieves 100% XML doc coverage on non-trivial types with CS1591 enforcement via Directory.Build.props. Coverage by project: - Butter: from 6.5% to 100% (DTOs, enums, MIME types) - Lactose: from ~28% to 100% (controllers, services, repos, jobs, models) - MilkStream.Client: from ~29% to 100% (all frontend services) Uses <inheritdoc /> on repository implementations (interfaces already documented) and full <summary>/<param>/<returns> tags elsewhere. Enums include member-level docs.
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Butter.Dtos.Album;
|
|
using Lactose.Models;
|
|
|
|
namespace Lactose.Mapper;
|
|
|
|
/// <summary>
|
|
/// provides mapping methods for converting Album objects to DTOs.
|
|
/// </summary>
|
|
public static class AlbumMapper {
|
|
/// <summary>
|
|
/// Maps an Album object to an AlbumFullDto object.
|
|
/// </summary>
|
|
/// <param name="album">The album to map.</param>
|
|
/// <returns>An AlbumFullDto object.</returns>
|
|
public static AlbumFullDto ToAlbumFullDto(this Album album) => new AlbumFullDto {
|
|
Id = album.Id,
|
|
Name = album.Title,
|
|
Owner = album.UserOwnerId,
|
|
Person = album.PersonOwnerId,
|
|
Images = album.Assets!.Select(asset => asset.Id).ToList()
|
|
};
|
|
|
|
/// <summary>
|
|
/// Maps an Album object to an AlbumPreviewDto object.
|
|
/// </summary>
|
|
/// <param name="album">The album to map.</param>
|
|
/// <returns>An AlbumPreviewDto object.</returns>
|
|
public static AlbumPreviewDto ToAlbumPreviewDto(this Album album) => new AlbumPreviewDto {
|
|
Id = album.Id,
|
|
Name = album.Title,
|
|
Owner = album.UserOwnerId,
|
|
Person = album.PersonOwnerId
|
|
};
|
|
|
|
|
|
|
|
}
|