เช็ค ocId user

This commit is contained in:
Kittapath 2023-05-13 03:51:18 +07:00
parent a85bf3526a
commit b89e500c21
7 changed files with 2217 additions and 2020 deletions

View file

@ -16,6 +16,7 @@ using BMA.EHR.Recruit.Service.Data;
using BMA.EHR.Recruit.Service;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using BMA.EHR.Recruit.Service.Services;
using BMA.EHR.Recurit.Service.Data;
var builder = WebApplication.CreateBuilder(args);
var issuer = builder.Configuration["Jwt:Issuer"];
@ -74,7 +75,10 @@ BsonSerializer.RegisterSerializer(new DateTimeSerializer(BsonType.String));
// Register DbContext
var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection)), ServiceLifetime.Transient);
options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection)));
var metadataConnection = builder.Configuration.GetConnectionString("MetadataConnection");
builder.Services.AddDbContext<MetadataDbContext>(options =>
options.UseMySql(metadataConnection, ServerVersion.AutoDetect(metadataConnection)));
// Add config CORS
builder.Services.AddCors(options => options.AddDefaultPolicy(builder =>