Skip to content

furkandeveloper/EntityFrameworkCore.DataEncryption

Repository files navigation

Gitmoji


Give a Star 🌟

If you liked the project or if EntityFrameworkCore.DataEncryption helped you, please give a star.


Purpose

EntityFrameworkCore.DataEncryption with the entity framework core value converter feature, it allows you to store your data by encrypting it.


Summary

Install-Package EntityFrameworkCore.DataEncryption.Conversions

Then mark the columns to be encrypted in DbContext.

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    modelBuilder.Entity<Author>(entity =>
    {
        entity
            .Property(p => p.Id)
            .UseIdentityColumn();
        entity
            .Property(p => p.Name)
            .IsRequired()
            .HasMaxLength(2048);
        
        entity
            .Property(p => p.Surname)
            .IsRequired()
            .HasMaxLength(2048);
        entity
            .Property(p => p.Phone)
            .IsRequired()
            .HasConversion(new EncryptValueConverter(key:"89acMXSBpuEBDWHZ"));
    });
    base.OnModelCreating(modelBuilder);
}

Documentation

Visit wiki documentation. Wiki


Sample Project

See for more information visit sample project

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy