Skip to content

Commit

Permalink
change AutoMapper profile DI (for v.13)
Browse files Browse the repository at this point in the history
  • Loading branch information
second-slip committed Feb 18, 2024
1 parent 979d719 commit 64e2695
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Birder/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Azure.Identity;
using AutoMapper;
using Azure.Identity;
using Birder.MinApiEndpoints;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using SendGrid.Extensions.DependencyInjection;
using System.Diagnostics.CodeAnalysis;

var builder = WebApplication.CreateBuilder(args);

Expand Down Expand Up @@ -58,7 +58,13 @@
.AddDefaultTokenProviders()
.AddSignInManager<SignInManager<ApplicationUser>>();

builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
// builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
var configuration = new MapperConfiguration(cfg =>
{
cfg.AddProfile<BirderMappingProfile>();
});

builder.Services.AddSingleton(configuration);


builder.Services.AddHttpClient();
Expand Down

0 comments on commit 64e2695

Please sign in to comment.