39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
using Azure;
|
|
using Azure.Core;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.SelfService.Portal.Core.API.Extensions.Dataannotations;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Microsoft.SelfService.Portal.Core.API.Models
|
|
{
|
|
public class BaseModel
|
|
{
|
|
[Column(Order = 0)]
|
|
[DefaultValueSql("NEWID()")]
|
|
//[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
|
public Guid Id { get; set; }
|
|
|
|
[Column(Order = 50)]
|
|
[DefaultValueSql("GETDATE()")]
|
|
//[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
|
public DateTime Modified { get; set; } = DateTime.Now;
|
|
|
|
[Column(Order = 51)]
|
|
[DefaultValue("System")]
|
|
//[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
|
public string ModifiedBy { get; set; } = new HttpContextAccessor().HttpContext.User.Identity.Name;
|
|
|
|
[Column(Order = 52)]
|
|
[DefaultValueSql("GETDATE()")]
|
|
//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public DateTime Created { get; set; } = DateTime.Now;
|
|
|
|
[Column(Order = 53)]
|
|
[DefaultValue("System")]
|
|
//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
//public string CreatedBy { get; set; } = "CCIS-P01S01-CM\\ASA_SSP_Admin";
|
|
public string CreatedBy { get; set; } = new HttpContextAccessor().HttpContext.User.Identity.Name;
|
|
}
|
|
}
|