Skip to content

Commit 908dbe7

Browse files
committed
Add dataprotection to Program.cs
1 parent 703fd8a commit 908dbe7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

EmailService-API/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.AspNetCore.Authentication.JwtBearer;
66
using Microsoft.IdentityModel.Tokens;
77
using System.Text;
8+
using Microsoft.AspNetCore.DataProtection;
89

910
namespace EmailService_API
1011
{
@@ -18,6 +19,9 @@ public static void Main(string[] args)
1819
var connectionString = builder.Configuration.GetConnectionString("EmailServiceContextConnection");
1920
builder.Services.AddDbContext<EmailServiceContext>(options =>
2021
options.UseSqlServer(connectionString));
22+
23+
builder.Services.AddDataProtection()
24+
.PersistKeysToDbContext<EmailServiceContext>();
2125

2226
builder.Services.AddControllers();
2327

0 commit comments

Comments
 (0)