roadie/Roadie.Api.Library/Data/EntityBase.cs

41 lines
1,004 B
C#
Raw Normal View History

2018-11-06 16:59:48 -06:00
using Mapster;
using Roadie.Library.Enums;
2018-11-02 16:04:49 -05:00
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
public abstract class EntityBase
{
[Column("createdDate")]
[Required]
public DateTime CreatedDate { get; set; }
[Column("id")]
[Key]
2018-12-23 15:36:38 -06:00
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
2018-11-02 16:04:49 -05:00
public int Id { get; set; }
public bool? IsLocked { get; set; }
[Column("lastUpdated")]
public DateTime? LastUpdated { get; set; }
2018-11-03 16:21:36 -05:00
[Column("RoadieId")]
2018-11-02 16:04:49 -05:00
[Required]
public Guid RoadieId { get; set; }
[Column("status")]
2018-11-11 11:27:13 -06:00
public Statuses? Status { get; set; }
2018-11-03 16:21:36 -05:00
public EntityBase()
{
this.RoadieId = Guid.NewGuid();
this.Status = Statuses.Incomplete;
this.CreatedDate = DateTime.UtcNow;
2018-11-16 20:14:32 -06:00
this.IsLocked = false;
2018-11-03 16:21:36 -05:00
}
2018-11-02 16:04:49 -05:00
}
}