Created
December 30, 2020 21:14
-
-
Save JIOO-phoeNIX/34d2a35ef1c8410f2eaa6013065ba565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
namespace GraphQLSampleApp.DataAccess.Entity | |
{ | |
public class Employee | |
{ | |
[Key] | |
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | |
public int EmployeeId { get; set; } | |
[Required] | |
public string Name { get; set; } | |
[Required] | |
[EmailAddress] | |
public string Email { get; set; } | |
[Required] | |
[Range(minimum: 20, maximum: 50)] | |
public int Age { get; set; } | |
public int DepartmentId { get; set; } | |
public Department Department { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment