🧹 Clean up
continuous-integration/drone/push Build is passing Details

pull/65/head
Alexis Drai 2 years ago
parent cfcab3316f
commit c108032b26

@ -4,8 +4,6 @@ using cat_cafe.Entities;
using cat_cafe.Repositories; using cat_cafe.Repositories;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using Serilog;
namespace cat_cafe.Controllers namespace cat_cafe.Controllers
{ {

@ -9,9 +9,10 @@ namespace cat_cafe.Mappers
public BarMapper() public BarMapper()
{ {
CreateMap<Bar, BarDto>() CreateMap<Bar, BarDto>()
.ForMember(dest => dest.CatIds, opt => opt.MapFrom(src => src.Cats.Select(c => c.Id))); .ForMember(dest => dest.CatIds, opt => opt.MapFrom(src => src.Cats.Select(c => c.Id)));
CreateMap<BarDto, Bar>(); CreateMap<BarDto, Bar>();
} }
} }
} }

@ -2,6 +2,7 @@
using cat_cafe.Dto; using cat_cafe.Dto;
using cat_cafe.Entities; using cat_cafe.Entities;
namespace cat_cafe.Mappers namespace cat_cafe.Mappers
{ {
public class CustomerMapper : Profile public class CustomerMapper : Profile

@ -1,9 +1,7 @@
using cat_cafe.Repositories; using cat_cafe.Repositories;
using cat_cafe.WeSo; using cat_cafe.WeSo;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Serilog;
using System.Net.WebSockets; using System.Net.WebSockets;
using Microsoft.Extensions.Logging;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@ -12,7 +10,7 @@ List<WebSocket> _sockets = new();
// Add services to the container. // Add services to the container.
builder.Services.AddLogging(configure => configure.AddFile("log.txt")); builder.Services.AddLogging(configure => configure.AddFile("log.txt"));
builder.Services.AddSingleton<List<WebSocket>>(x => _sockets); builder.Services.AddSingleton(x => _sockets);
builder.Services.AddSingleton<WebSocketHandler>(); builder.Services.AddSingleton<WebSocketHandler>();
builder.Services.AddControllers(); builder.Services.AddControllers();
builder.Services.AddDbContext<CatCafeContext>(opt => opt.UseSqlite("Data Source=cat_cafe.db")); builder.Services.AddDbContext<CatCafeContext>(opt => opt.UseSqlite("Data Source=cat_cafe.db"));

Loading…
Cancel
Save