Skip to content

Instantly share code, notes, and snippets.

@JIOO-phoeNIX
Created December 30, 2020 21:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JIOO-phoeNIX/34d2a35ef1c8410f2eaa6013065ba565 to your computer and use it in GitHub Desktop.
Save JIOO-phoeNIX/34d2a35ef1c8410f2eaa6013065ba565 to your computer and use it in GitHub Desktop.
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