Skip to content

.NET 7, nothing happens #24

@uenlkr4e

Description

@uenlkr4e

Hi,
i am using .NET 7 and i did exactly what you described in documentation but nothing happens, my data is still saved in clear text.
Am i missing something?

here is my dbcontext:

private readonly IEncryptionProvider _provider;
public AppDbContext()
{
_provider = new GenerateEncryptionProvider("example_encrypt_key");
}
.....
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.UseEncryption(_provider);
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);

    OnModelCreatingPartial(modelBuilder);

    base.OnModelCreating(modelBuilder);
}

and my entity model:
[EncryptColumn]
public string UserName { get; set; }

    [EncryptColumn]
    public string FirstName { get; set; }
    
    public string Email { get; set; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions