/
afanasevn
/
MaxSystems
Обзор
Документация
Войти
/
afanasevn
/
MaxSystems
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/MaxSystems.Infrastructure/Data/Configurations/UserConfiguration.cs
24 строки
906 B
IBS\NAfanasev
Add project files.
18 июн 2026, 01:12
18 июн 2026, 01:12
b06aa39
Код
Авторство
О чём код?
using MaxSystems.Domain.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace MaxSystems.Infrastructure.Data.Configurations; public class UserConfiguration : IEntityTypeConfiguration<User> { public void Configure(EntityTypeBuilder<User> builder) { builder.ToTable("users"); builder.HasKey(x => x.Id); builder.Property(x => x.Email).HasMaxLength(256).IsRequired(); builder.HasIndex(x => x.Email).IsUnique(); builder.Property(x => x.Name).HasMaxLength(256).IsRequired(); builder.Property(x => x.PasswordHash).HasMaxLength(512).IsRequired(); builder.Property(x => x.Role).HasConversion<string>().HasMaxLength(32).IsRequired(); builder.Property(x => x.Active).HasDefaultValue(true); builder.Property(x => x.CreatedAt).HasDefaultValueSql("CURRENT_TIMESTAMP"); } }