Fleshed out entity classes and created command to create student

This commit is contained in:
2019-04-24 23:57:55 +00:00
parent a30e9a5b1c
commit acba25cc0b
13 changed files with 129 additions and 27 deletions

View File

@@ -1,15 +1,21 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace BrightGlimmer.Domain
{
public class Entity
{
public Guid Id { get; set; }
public bool IsDeleted { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime ModifiedDate { get; set; }
[Key]
public Guid Id { get; private set; }
[JsonIgnore]
public bool IsDeleted { get; protected set; }
[JsonIgnore]
public DateTime CreatedDate { get; protected set; }
[JsonIgnore]
public DateTime ModifiedDate { get; protected set; }
public Entity()
{
@@ -17,6 +23,15 @@ namespace BrightGlimmer.Domain
CreatedDate = DateTime.UtcNow;
ModifiedDate = DateTime.UtcNow;
}
}
protected void Delete()
{
IsDeleted = true;
}
protected void MarkModified()
{
ModifiedDate = DateTime.UtcNow;
}
}
}