Initial code commit.
This commit is contained in:
13
Sufi.Demo.PeopleDirectory.Domain/Common/AuditableEntity.cs
Normal file
13
Sufi.Demo.PeopleDirectory.Domain/Common/AuditableEntity.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace Sufi.Demo.PeopleDirectory.Domain.Common
|
||||
{
|
||||
public abstract class AuditableEntity<TId> : IAuditableEntity<TId>
|
||||
{
|
||||
public TId Id { get; set; } = default!;
|
||||
public string? CreatedBy { get; set; }
|
||||
public DateTime CreatedOn { get; set; }
|
||||
public string? LastModifiedBy { get; set; }
|
||||
public DateTime? LastModifiedOn { get; set; }
|
||||
}
|
||||
}
|
||||
17
Sufi.Demo.PeopleDirectory.Domain/Common/IAuditableEntity.cs
Normal file
17
Sufi.Demo.PeopleDirectory.Domain/Common/IAuditableEntity.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace Sufi.Demo.PeopleDirectory.Domain.Common
|
||||
{
|
||||
public interface IAuditableEntity<TId> : IAuditableEntity, IEntity<TId>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public interface IAuditableEntity : IEntity
|
||||
{
|
||||
string? CreatedBy { get; set; }
|
||||
DateTime CreatedOn { get; set; }
|
||||
string? LastModifiedBy { get; set; }
|
||||
DateTime? LastModifiedOn { get; set; }
|
||||
}
|
||||
}
|
||||
14
Sufi.Demo.PeopleDirectory.Domain/Common/IEntity.cs
Normal file
14
Sufi.Demo.PeopleDirectory.Domain/Common/IEntity.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Sufi.Demo.PeopleDirectory.Domain.Common
|
||||
{
|
||||
public interface IEntity
|
||||
{
|
||||
}
|
||||
|
||||
public interface IEntity<TId> : IEntity
|
||||
{
|
||||
[Key]
|
||||
TId Id { get; set; }
|
||||
}
|
||||
}
|
||||
27
Sufi.Demo.PeopleDirectory.Domain/Entities/Misc/Contact.cs
Normal file
27
Sufi.Demo.PeopleDirectory.Domain/Entities/Misc/Contact.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Sufi.Demo.PeopleDirectory.Domain.Common;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Sufi.Demo.PeopleDirectory.Domain.Entities.Misc
|
||||
{
|
||||
public class Contact : AuditableEntity<int>
|
||||
{
|
||||
[Required]
|
||||
[Column(TypeName = "character varying(50)")]
|
||||
public string UserName { get; set; } = null!;
|
||||
[Required]
|
||||
[Phone]
|
||||
[Column(TypeName = "character varying(20)")]
|
||||
public string Phone { get; set; } = null!;
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
[Column(TypeName = "character varying(100)")]
|
||||
public string Email { get; set; } = null!;
|
||||
[Required]
|
||||
[Column(TypeName = "character varying(255)")]
|
||||
public string SkillSets { get; set; } = null!;
|
||||
[Required]
|
||||
[Column(TypeName = "character varying(255)")]
|
||||
public string Hobby { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
13
Sufi.Demo.PeopleDirectory.Domain/Entities/Misc/ServerInfo.cs
Normal file
13
Sufi.Demo.PeopleDirectory.Domain/Entities/Misc/ServerInfo.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Sufi.Demo.PeopleDirectory.Domain.Common;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Sufi.Demo.PeopleDirectory.Domain.Entities.Misc
|
||||
{
|
||||
public class ServerInfo : AuditableEntity<string>
|
||||
{
|
||||
[Required]
|
||||
[Column(TypeName = "character varying(255)")]
|
||||
public string Value { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user