Adds JetBrains.Annotations to reduce amount of false positives by static code analysis
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
using FastEndpoints;
|
||||
using FluentValidation;
|
||||
using Hutopy.Web.Features.Contents.Data;
|
||||
using Hutopy.Web.Features.Contents.Data;
|
||||
using Hutopy.Web.Features.Contents.Handlers.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Hutopy.Web.Features.Contents.Handlers;
|
||||
|
||||
[PublicAPI]
|
||||
public sealed class GetCreatorByAliasRequest
|
||||
{
|
||||
public required string Name { get; set; }
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class GetCreatorByAliasRequestValidator
|
||||
: Validator<GetCreatorByAliasRequest>
|
||||
{
|
||||
@@ -22,6 +21,7 @@ public sealed class GetCreatorByAliasRequestValidator
|
||||
}
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public class GetCreatorByAliasHandler(
|
||||
ContentDbContext context)
|
||||
: Endpoint<GetCreatorByAliasRequest, CreatorModel>
|
||||
@@ -54,18 +54,16 @@ public class GetCreatorByAliasHandler(
|
||||
s => s.CreatorId == creator.Id,
|
||||
cancellationToken: ct);
|
||||
|
||||
var model = new CreatorModel
|
||||
{
|
||||
Id = creator.Id,
|
||||
CreatedBy = creator.CreatedBy,
|
||||
CreatedAt = creator.CreatedAt,
|
||||
Name = creator.Name,
|
||||
About = creator.About,
|
||||
Socials = creator.Socials,
|
||||
Colors = creator.Colors,
|
||||
Images = creator.Images,
|
||||
SubscriberCount = subscriberCount,
|
||||
};
|
||||
var model = new CreatorModel(
|
||||
creator.Id,
|
||||
creator.CreatedBy,
|
||||
creator.CreatedAt,
|
||||
creator.Name,
|
||||
creator.About,
|
||||
creator.Socials,
|
||||
creator.Colors,
|
||||
creator.Images,
|
||||
subscriberCount);
|
||||
|
||||
await SendAsync(model, cancellation: ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user