/
gamma
/
Gamma-API
Обзор
Документация
Войти
/
gamma
/
Gamma-API
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
Gamma.Data.Configurations/UserConfiguration.cs
25 строк
976 B
Vlavimir Solodovnikov
Добавьте файлы проекта.
07 июн 2022, 23:02
07 июн 2022, 23:02
d125135
Код
Авторство
О чём код?
using Gamma.Data.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Gamma.Data.Configurations { public class UserConfiguration : IEntityTypeConfiguration<User> { public void Configure(EntityTypeBuilder<User> builder) { builder.HasKey(x => x.UserId); builder.Property(x => x.Role).IsRequired(); builder.Property(x => x.Login).IsRequired().HasMaxLength(20); builder.Property(x => x.Password).IsRequired().HasMaxLength(255); builder.Property(x => x.FirstName).IsRequired().HasMaxLength(30); builder.Property(x => x.LastName).IsRequired().HasMaxLength(20); builder.Property(x => x.IsDeleted).IsRequired(); builder.Property(x => x.CreatedDate).IsRequired(); builder.Property(x => x.UpdatedDate).IsRequired(); builder.HasIndex(x => x.Login).IsUnique(); } } }