Files
dotNetStudyWithGPT/MySolution/ToDoApp/Model/User.cs
2023-10-27 18:07:18 +09:00

36 lines
744 B
C#

using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ToDoApp.Model
{
public enum UserStatus
{
Valid,
Invalid
}
[Index(nameof(Name), IsUnique = true)]
public class User
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string Password { get; set; }
[EmailAddress(ErrorMessage = "Invalid email format")]
public string? Email { get; set; }
public DateTime CreateDate { get; set; }
public UserStatus Status { get; set; }
}
}