Skip to content

Commit 86cae16

Browse files
committed
style: resolve CS8618 and CS1998 warnings
- Add required modifier to non-nullable properties in SpeakerCommand, OrganizerCommand, and EventCommand - Add await Task.CompletedTask to placeholder async methods in controllers to resolve async method lacks await warnings
1 parent 125dd7e commit 86cae16

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

EventFlow.Application/Commands/EventCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ namespace EventFlow.Application.Commands;
33
public class EventCommand
44
{
55
public int Id { get; private set; }
6-
public string Title { get; set; }
6+
public required string Title { get; set; }
77
public string? Description { get; set; }
88
public DateTime Date { get; set; }
9-
public string Location { get; set; }
9+
public required string Location { get; set; }
1010
public int OrganizerId { get; set; }
1111
}

EventFlow.Application/Commands/OrganizerCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace EventFlow.Application.Commands;
22

33
public class OrganizerCommand
44
{
5-
public string Name { get; set; }
6-
public string Email { get; set; }
5+
public required string Name { get; set; }
6+
public required string Email { get; set; }
77
}

EventFlow.Application/Commands/SpeakerCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ namespace EventFlow.Application.Commands;
44

55
public class SpeakerCommand
66
{
7-
public string Name { get; set; }
8-
public string Email { get; set; }
7+
public required string Name { get; set; }
8+
public required string Email { get; set; }
99
public string? Biography { get; set; }
1010

1111
[JsonIgnore]

EventFlow.Presentation/Controllers/OrganizerController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task<IActionResult> PostAsync([FromBody] CreateOrganizerCommand com
3131
public async Task<IActionResult> RegisterParticipantAsync(int organizerId, int eventId)
3232
{
3333
// TODO: Implementar RegisterOrganizerToEventCommand
34-
// Por enquanto mantendo o service call ou pode ser implementado depois
34+
await Task.CompletedTask;
3535
return Ok(new { message = "Evento vinculado ao organizador com sucesso." });
3636
}
3737

EventFlow.Presentation/Controllers/ParticipantController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task<IActionResult> PostAsync([FromBody] CreateParticipantCommand c
3131
public async Task<IActionResult> RegisterParticipantAsync(int eventId, int participantId)
3232
{
3333
// TODO: Implementar RegisterParticipantToEventCommand
34-
// Por enquanto mantendo retorno de sucesso ou pode ser implementado depois
34+
await Task.CompletedTask;
3535
return Ok(new { message = "Participante vinculado ao evento com sucesso." });
3636
}
3737

EventFlow.Presentation/Controllers/SpeakerController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task<IActionResult> PostAsync([FromBody] CreateSpeakerCommand comma
3131
public async Task<IActionResult> RegisterToEventAsync(int speakerId, int eventId)
3232
{
3333
// TODO: Implementar RegisterSpeakerToEventCommand
34-
// Por enquanto mantendo retorno de sucesso ou pode ser implementado depois
34+
await Task.CompletedTask;
3535
return Ok(new { message = "Palestrante vinculado com sucesso ao evento." });
3636
}
3737

0 commit comments

Comments
 (0)