Skip to content

Instantly share code, notes, and snippets.

@eestein
Created June 19, 2016 23:10
Show Gist options
  • Save eestein/5a657ebe1ead739eaac5b00f2043bebe to your computer and use it in GitHub Desktop.
Save eestein/5a657ebe1ead739eaac5b00f2043bebe to your computer and use it in GitHub Desktop.
[Table("Employees", Schema = "MyAppSchema")]
public class EmployeeProfile : Profile
{
/// <summary>
/// Id da empresa
/// </summary>
public int CompanyId { get; set; }
/// <summary>
/// Empresa
/// </summary>
[ForeignKey("CompanyId")]
public virtual Company Company { get; set; }
/// <summary>
/// Posição
/// </summary>
public EmployeeRank Rank { get; set; }
/// <summary>
/// Data de associação
/// </summary>
public DateTime JoinDate { get; set; }
/// <summary>
/// Data de remoção
/// </summary>
public DateTime? RemovalDate { get; set; }
/// <summary>
/// Indica se o funcionário está ativo
/// </summary>
public virtual bool IsActive => !RemovalDate.HasValue || DateTime.Now <= RemovalDate.Value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment