Skip to content

Commit

Permalink
Merge pull request #10 from sentemon/fix-all-warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
sentemon authored Dec 29, 2024
2 parents 7f33c64 + d925bc2 commit e8dad15
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
7 changes: 5 additions & 2 deletions backend/src/AuthService/AuthService.Domain/Entities/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public class User
public string ImageUrl { get; private set; }
public DateTime CreatedAt { get; private set; }

private User() { }

private User(string id, string firstName, string lastName, Username username, Email email, string? imageUrl = null)
{
Id = id;
Expand Down Expand Up @@ -56,4 +54,9 @@ public void VerifyEmail()
{
EmailVerified = true;
}

#pragma warning disable CS8618
// Required by EF Core
private User() { }
#pragma warning restore CS8618
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace Shared.Application.Abstractions;

public interface ICommand
{
}
public interface ICommand;
4 changes: 1 addition & 3 deletions backend/src/Shared/Shared.Application/Abstractions/IQuery.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace Shared.Application.Abstractions;

public interface IQuery
{
}
public interface IQuery;
8 changes: 6 additions & 2 deletions backend/src/Shared/Shared.Application/Common/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ namespace Shared.Application.Common;
public class Result<TResponse> : IResult<TResponse, Error>
{

#pragma warning disable CS8766
public TResponse? Response { get; }
public Error? Error { get; }
#pragma warning restore CS8766
public bool IsSuccess { get; }
public HttpStatusCode StatusCode { get; }

private Result(TResponse? response)
private Result(TResponse response)
{
Response = response;
Error = default;
IsSuccess = true;
StatusCode = HttpStatusCode.OK;
}

private Result(Error? error)
private Result(Error error)
{
Error = error;
Response = default;
IsSuccess = false;
StatusCode = HttpStatusCode.BadRequest;
}
Expand Down

0 comments on commit e8dad15

Please sign in to comment.