Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 2e9e740

Browse files
committed
Fix tratar avisos como erros #5
1 parent d43fcd8 commit 2e9e740

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

DevEncurtaUrl.API/Controllers/ShortenedLinksController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public class ShortenedLinksController : ControllerBase
1212
{
1313
private readonly DevEncurtaUrlDbContext _context;
1414

15+
/// <summary>
16+
/// Construtor
17+
/// </summary>
18+
/// <param name="context"></param>
1519
public ShortenedLinksController(DevEncurtaUrlDbContext context)
1620
=> _context = context;
1721

DevEncurtaUrl.API/DevEncurtaUrl.API.csproj

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
54
<Nullable>enable</Nullable>
65
<ImplicitUsings>enable</ImplicitUsings>
6+
<TargetFramework>net7.0</TargetFramework>
7+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<NoWarn>ASP0013;1591</NoWarn>
79
</PropertyGroup>
810

9-
<PropertyGroup>
10-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
11-
<NoWarn>$(NoWarn);1591</NoWarn>
12-
<NoWarn>$(NoWarn);8618</NoWarn>
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
12+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
13+
</PropertyGroup>
14+
15+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
16+
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
1317
</PropertyGroup>
14-
18+
1519
<ItemGroup>
1620
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.20" />
1721
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.20">

DevEncurtaUrl.API/Entities/ShortenedCustomLink.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ public class ShortenedCustomLink
44
{
55
public int Id { get; set; }
66

7-
public string Title { get; set; }
7+
public string Title { get; set; } = string.Empty;
88

9-
public string DestinationLink { get; set; }
9+
public string DestinationLink { get; set; } = string.Empty;
1010

11-
public string ShortenedLink { get; set; }
11+
public string ShortenedLink { get; set; } = string.Empty;
1212

13-
public string Code { get; set; }
13+
public string Code { get; set; } = string.Empty;
1414

15-
public string CreatedAt { get; set; }
15+
public string CreatedAt { get; set; } = string.Empty;
1616

1717
private ShortenedCustomLink() { }
1818

DevEncurtaUrl.API/Models/AddOrUpdateShortenedLinkModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ public class AddOrUpdateShortenedLinkModel
44
{
55
public int Id { get; set; }
66

7-
public string Title { get; set; }
7+
public string Title { get; set; } = string.Empty;
88

9-
public string DestinationLink { get; set; }
9+
public string DestinationLink { get; set; } = string.Empty;
1010
}
1111
}

DevEncurtaUrl.API/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
app.UseSwagger();
9898
app.UseSwaggerUI(o =>
9999
{
100-
// TODO: Remover /swagger para acessar o SWAGGER
100+
// Mantido SWAGGER em /swagger, existe rota usando /{code}
101101
o.RoutePrefix = "swagger";
102102
o.SwaggerEndpoint("/swagger/v1/swagger.json", "DevEncurtaUrl.API v1");
103103
});

0 commit comments

Comments
 (0)