Rename WebApi project to Vegasco.Server.Api
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
And update all references including comments etc.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Vegasco.WebApi.Authentication;
|
||||
namespace Vegasco.Server.Api.Authentication;
|
||||
|
||||
public class JwtOptions
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace Vegasco.WebApi.Authentication;
|
||||
namespace Vegasco.Server.Api.Authentication;
|
||||
|
||||
public sealed class UserAccessor
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Vegasco.WebApi.Consumptions;
|
||||
using Vegasco.WebApi.Users;
|
||||
using Vegasco.Server.Api.Consumptions;
|
||||
using Vegasco.Server.Api.Users;
|
||||
|
||||
namespace Vegasco.WebApi.Cars;
|
||||
namespace Vegasco.Server.Api.Cars;
|
||||
|
||||
public class Car
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using StronglyTypedIds;
|
||||
|
||||
namespace Vegasco.WebApi.Cars;
|
||||
namespace Vegasco.Server.Api.Cars;
|
||||
|
||||
[StronglyTypedId]
|
||||
public partial struct CarId;
|
||||
@@ -1,11 +1,11 @@
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using Vegasco.WebApi.Authentication;
|
||||
using Vegasco.WebApi.Common;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.WebApi.Users;
|
||||
using Vegasco.Server.Api.Authentication;
|
||||
using Vegasco.Server.Api.Common;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
using Vegasco.Server.Api.Users;
|
||||
|
||||
namespace Vegasco.WebApi.Cars;
|
||||
namespace Vegasco.Server.Api.Cars;
|
||||
|
||||
public static class CreateCar
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Cars;
|
||||
namespace Vegasco.Server.Api.Cars;
|
||||
|
||||
public static class DeleteCar
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Cars;
|
||||
namespace Vegasco.Server.Api.Cars;
|
||||
|
||||
public static class GetCar
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Cars;
|
||||
namespace Vegasco.Server.Api.Cars;
|
||||
|
||||
public static class GetCars
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using Vegasco.WebApi.Authentication;
|
||||
using Vegasco.WebApi.Common;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Authentication;
|
||||
using Vegasco.Server.Api.Common;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Cars;
|
||||
namespace Vegasco.Server.Api.Cars;
|
||||
|
||||
public static class UpdateCar
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Vegasco.WebApi.Common;
|
||||
namespace Vegasco.Server.Api.Common;
|
||||
|
||||
public static class Constants
|
||||
{
|
||||
@@ -2,18 +2,19 @@
|
||||
using FluentValidation;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Vegasco.WebApi.Authentication;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Authentication;
|
||||
using Vegasco.Server.Api.Common;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Common;
|
||||
namespace Vegasco.Server.Api.Common;
|
||||
|
||||
public static class DependencyInjectionExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds all the WebApi related services to the Dependency Injection container.
|
||||
/// Adds all the Api related services to the Dependency Injection container.
|
||||
/// </summary>
|
||||
/// <param name="builder"></param>
|
||||
public static void AddWebApiServices(this IHostApplicationBuilder builder)
|
||||
public static void AddApiServices(this IHostApplicationBuilder builder)
|
||||
{
|
||||
builder.Services
|
||||
.AddMiscellaneousServices()
|
||||
@@ -30,7 +31,7 @@ public static class DependencyInjectionExtensions
|
||||
|
||||
services.AddValidatorsFromAssemblies(
|
||||
[
|
||||
typeof(IWebApiMarker).Assembly
|
||||
typeof(IApiMarker).Assembly
|
||||
], ServiceLifetime.Singleton);
|
||||
|
||||
services.AddHealthChecks();
|
||||
@@ -125,7 +126,7 @@ public static class DependencyInjectionExtensions
|
||||
|
||||
private static IHostApplicationBuilder AddDbContext(this IHostApplicationBuilder builder)
|
||||
{
|
||||
builder.AddNpgsqlDbContext<ApplicationDbContext>(Server.AppHost.Shared.Constants.Database.Name);
|
||||
builder.AddNpgsqlDbContext<ApplicationDbContext>(AppHost.Shared.Constants.Database.Name);
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using FluentValidation.Results;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Vegasco.WebApi.Common;
|
||||
namespace Vegasco.Server.Api.Common;
|
||||
|
||||
public class FluentValidationOptions<TOptions> : IValidateOptions<TOptions>
|
||||
where TOptions : class
|
||||
3
src/Vegasco.Server.Api/Common/IApiMarker.cs
Normal file
3
src/Vegasco.Server.Api/Common/IApiMarker.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Vegasco.Server.Api.Common;
|
||||
|
||||
public interface IApiMarker;
|
||||
@@ -1,8 +1,9 @@
|
||||
using Microsoft.AspNetCore.Localization;
|
||||
using System.Globalization;
|
||||
using Vegasco.WebApi.Endpoints;
|
||||
using Vegasco.Server.Api.Endpoints;
|
||||
using Vegasco.Server.ServiceDefaults;
|
||||
|
||||
namespace Vegasco.WebApi.Common;
|
||||
namespace Vegasco.Server.Api.Common;
|
||||
|
||||
internal static class StartupExtensions
|
||||
{
|
||||
@@ -12,7 +13,7 @@ internal static class StartupExtensions
|
||||
|
||||
builder.Configuration.AddEnvironmentVariables("Vegasco_");
|
||||
|
||||
builder.AddWebApiServices();
|
||||
builder.AddApiServices();
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
return app;
|
||||
@@ -2,7 +2,7 @@
|
||||
using FluentValidation.Results;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Vegasco.WebApi.Common;
|
||||
namespace Vegasco.Server.Api.Common;
|
||||
|
||||
public static class ValidatorExtensions
|
||||
{
|
||||
@@ -38,7 +38,7 @@ public static class ValidatorExtensions
|
||||
{
|
||||
if (!combinedErrors.TryGetValue(error.PropertyName, out HashSet<string>? value))
|
||||
{
|
||||
value = ([error.ErrorMessage]);
|
||||
value = [error.ErrorMessage];
|
||||
combinedErrors[error.PropertyName] = value;
|
||||
continue;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Vegasco.WebApi.Cars;
|
||||
using Vegasco.Server.Api.Cars;
|
||||
|
||||
namespace Vegasco.WebApi.Consumptions;
|
||||
namespace Vegasco.Server.Api.Consumptions;
|
||||
|
||||
public class Consumption
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using StronglyTypedIds;
|
||||
|
||||
namespace Vegasco.WebApi.Consumptions;
|
||||
namespace Vegasco.Server.Api.Consumptions;
|
||||
|
||||
|
||||
[StronglyTypedId]
|
||||
@@ -1,10 +1,10 @@
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using Vegasco.WebApi.Cars;
|
||||
using Vegasco.WebApi.Common;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Cars;
|
||||
using Vegasco.Server.Api.Common;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Consumptions;
|
||||
namespace Vegasco.Server.Api.Consumptions;
|
||||
|
||||
public static class CreateConsumption
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Consumptions;
|
||||
namespace Vegasco.Server.Api.Consumptions;
|
||||
|
||||
public static class DeleteConsumption
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Consumptions;
|
||||
namespace Vegasco.Server.Api.Consumptions;
|
||||
|
||||
public static class GetConsumption
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Consumptions;
|
||||
namespace Vegasco.Server.Api.Consumptions;
|
||||
|
||||
public static class GetConsumptions
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using Vegasco.WebApi.Common;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Common;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
namespace Vegasco.WebApi.Consumptions;
|
||||
namespace Vegasco.Server.Api.Consumptions;
|
||||
|
||||
public static class UpdateConsumption
|
||||
{
|
||||
@@ -1,12 +1,11 @@
|
||||
using Asp.Versioning.Builder;
|
||||
using Asp.Versioning.Conventions;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Vegasco.WebApi.Cars;
|
||||
using Vegasco.WebApi.Common;
|
||||
using Vegasco.WebApi.Consumptions;
|
||||
using Vegasco.WebApi.Info;
|
||||
using Vegasco.Server.Api.Cars;
|
||||
using Vegasco.Server.Api.Common;
|
||||
using Vegasco.Server.Api.Consumptions;
|
||||
using Vegasco.Server.Api.Info;
|
||||
|
||||
namespace Vegasco.WebApi.Endpoints;
|
||||
namespace Vegasco.Server.Api.Endpoints;
|
||||
|
||||
public static class EndpointExtensions
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
|
||||
namespace Vegasco.WebApi.Info;
|
||||
namespace Vegasco.Server.Api.Info;
|
||||
|
||||
public class GetServerInfo
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Vegasco.WebApi.Cars;
|
||||
using Vegasco.WebApi.Common;
|
||||
using Vegasco.WebApi.Consumptions;
|
||||
using Vegasco.WebApi.Users;
|
||||
using Vegasco.Server.Api.Cars;
|
||||
using Vegasco.Server.Api.Common;
|
||||
using Vegasco.Server.Api.Consumptions;
|
||||
using Vegasco.Server.Api.Users;
|
||||
|
||||
namespace Vegasco.WebApi.Persistence;
|
||||
namespace Vegasco.Server.Api.Persistence;
|
||||
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : DbContext(options)
|
||||
{
|
||||
@@ -17,6 +17,6 @@ public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(IWebApiMarker).Assembly);
|
||||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(IApiMarker).Assembly);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Vegasco.WebApi.Persistence;
|
||||
namespace Vegasco.Server.Api.Persistence;
|
||||
|
||||
public class ApplyMigrationsService(ILogger<ApplyMigrationsService> logger, IServiceScopeFactory scopeFactory)
|
||||
: IHostedService
|
||||
@@ -5,11 +5,12 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Vegasco.WebApi.Persistence.Migrations
|
||||
namespace Vegasco.Server.Api.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20240818105918_Initial")]
|
||||
@@ -25,7 +26,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Cars.Car", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Cars.Car", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid");
|
||||
@@ -46,7 +47,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.ToTable("Cars");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Consumptions.Consumption", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Consumptions.Consumption", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid");
|
||||
@@ -73,7 +74,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.ToTable("Consumptions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Users.User", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Users.User", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
@@ -83,9 +84,9 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Cars.Car", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Cars.Car", b =>
|
||||
{
|
||||
b.HasOne("Vegasco.WebApi.Users.User", "User")
|
||||
b.HasOne("Vegasco.Server.Api.Users.User", "User")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -94,9 +95,9 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Consumptions.Consumption", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Consumptions.Consumption", b =>
|
||||
{
|
||||
b.HasOne("Vegasco.WebApi.Cars.Car", "Car")
|
||||
b.HasOne("Vegasco.Server.Api.Cars.Car", "Car")
|
||||
.WithMany("Consumptions")
|
||||
.HasForeignKey("CarId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -105,12 +106,12 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.Navigation("Car");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Cars.Car", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Cars.Car", b =>
|
||||
{
|
||||
b.Navigation("Consumptions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Users.User", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Users.User", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
});
|
||||
@@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Vegasco.WebApi.Persistence.Migrations
|
||||
namespace Vegasco.Server.Api.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Initial : Migration
|
||||
@@ -4,11 +4,12 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using Vegasco.WebApi.Persistence;
|
||||
using Vegasco.Server.Api.Persistence;
|
||||
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Vegasco.WebApi.Persistence.Migrations
|
||||
namespace Vegasco.Server.Api.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
||||
@@ -22,7 +23,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Cars.Car", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Cars.Car", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid");
|
||||
@@ -43,7 +44,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.ToTable("Cars");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Consumptions.Consumption", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Consumptions.Consumption", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uuid");
|
||||
@@ -70,7 +71,7 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.ToTable("Consumptions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Users.User", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Users.User", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
@@ -80,9 +81,9 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Cars.Car", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Cars.Car", b =>
|
||||
{
|
||||
b.HasOne("Vegasco.WebApi.Users.User", "User")
|
||||
b.HasOne("Vegasco.Server.Api.Users.User", "User")
|
||||
.WithMany("Cars")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -91,9 +92,9 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Consumptions.Consumption", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Consumptions.Consumption", b =>
|
||||
{
|
||||
b.HasOne("Vegasco.WebApi.Cars.Car", "Car")
|
||||
b.HasOne("Vegasco.Server.Api.Cars.Car", "Car")
|
||||
.WithMany("Consumptions")
|
||||
.HasForeignKey("CarId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
@@ -102,12 +103,12 @@ namespace Vegasco.WebApi.Persistence.Migrations
|
||||
b.Navigation("Car");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Cars.Car", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Cars.Car", b =>
|
||||
{
|
||||
b.Navigation("Consumptions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Vegasco.WebApi.Users.User", b =>
|
||||
modelBuilder.Entity("Vegasco.Server.Api.Users.User", b =>
|
||||
{
|
||||
b.Navigation("Cars");
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
using Vegasco.WebApi.Common;
|
||||
using Vegasco.Server.Api.Common;
|
||||
|
||||
WebApplication.CreateBuilder(args)
|
||||
.ConfigureServices()
|
||||
@@ -1,6 +1,6 @@
|
||||
using Vegasco.WebApi.Cars;
|
||||
using Vegasco.Server.Api.Cars;
|
||||
|
||||
namespace Vegasco.WebApi.Users;
|
||||
namespace Vegasco.Server.Api.Users;
|
||||
|
||||
public class User
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace Vegasco.WebApi.Users;
|
||||
namespace Vegasco.Server.Api.Users;
|
||||
|
||||
public class UserTableConfiguration : IEntityTypeConfiguration<User>
|
||||
{
|
||||
@@ -7,7 +7,7 @@
|
||||
<UserSecretsId>4bf893d3-0c16-41ec-8b46-2768d841215d</UserSecretsId>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
<RootNamespace>Vegasco.WebApi</RootNamespace>
|
||||
<RootNamespace>Vegasco.Server.Api</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -4,7 +4,7 @@ public static class Constants
|
||||
{
|
||||
public static class Projects
|
||||
{
|
||||
public const string WebApiName = "webapi";
|
||||
public const string Api = "Vegasco_Server_Api";
|
||||
}
|
||||
|
||||
public static class Database
|
||||
|
||||
@@ -7,7 +7,7 @@ IResourceBuilder<PostgresDatabaseResource> postgres = builder.AddPostgres(Consta
|
||||
.AddDatabase(Constants.Database.Name);
|
||||
|
||||
builder
|
||||
.AddProject<Projects.WebApi>(Constants.Projects.WebApiName)
|
||||
.AddProject<Projects.Vegasco_Server_Api>(Constants.Projects.Api)
|
||||
.WithReference(postgres)
|
||||
.WaitFor(postgres);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Vegasco.Server.AppHost.Shared\Vegasco.Server.AppHost.Shared.csproj" IsAspireProjectResource="false" />
|
||||
<ProjectReference Include="..\WebApi\WebApi.csproj" />
|
||||
<ProjectReference Include="..\Vegasco.Server.Api\Vegasco.Server.Api.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -2,13 +2,13 @@ using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.ServiceDiscovery;
|
||||
using OpenTelemetry;
|
||||
using OpenTelemetry.Metrics;
|
||||
using OpenTelemetry.Trace;
|
||||
|
||||
namespace Microsoft.Extensions.Hosting;
|
||||
namespace Vegasco.Server.ServiceDefaults;
|
||||
|
||||
// Adds common .NET Aspire services: service discovery, resilience, health checks, and OpenTelemetry.
|
||||
// This project should be referenced by each service project in your solution.
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Vegasco.WebApi.Common;
|
||||
|
||||
public interface IWebApiMarker;
|
||||
Reference in New Issue
Block a user