Skip to content

Commit 24589b4

Browse files
committed
Update project references and improve domain entities
Updated project references in various .csproj files to use newer versions of dependencies. Removed `netstandard2.1` from target frameworks in `Genocs.Common.csproj` and `Genocs.Core.csproj`. Changed primary key type from `int` to `Guid` for several domain entities and interfaces. Improved documentation comments and exception handling. Made `Id` property non-nullable in `Entity` class. Added `net8.0` target framework to `Genocs.SignalR.WebApi.csproj` and reorganized `Content` item group for certificates.
1 parent ded3efb commit 24589b4

File tree

14 files changed

+37
-43
lines changed

14 files changed

+37
-43
lines changed

src/Genocs.Auth/Genocs.Auth.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
</ItemGroup>
4949

5050
<ItemGroup Condition="'$(Configuration)' == 'Release'">
51-
<PackageReference Include="Genocs.Core" Version="6.0.*" />
52-
<PackageReference Include="Genocs.Security" Version="6.0.*" />
51+
<PackageReference Include="Genocs.Core" Version="6.2.*" />
52+
<PackageReference Include="Genocs.Security" Version="6.2.*" />
5353
</ItemGroup>
5454

5555
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">

src/Genocs.Common/Configurations/AppOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class AppOptions
1515
/// </summary>
1616
public bool Enabled { get; set; }
1717

18-
1918
/// <summary>
2019
/// Application name.
2120
/// </summary>

src/Genocs.Common/Genocs.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.1</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
55
<PackageId>Genocs.Common</PackageId>
66
<RootNamespace>Genocs.Common</RootNamespace>
77
<AssemblyName>Genocs.Common</AssemblyName>

src/Genocs.Core/Domain/Entities/AggregateRoot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Genocs.Core.Domain.Entities;
77

8-
public class AggregateRoot : AggregateRoot<int>, IAggregateRoot
8+
public class AggregateRoot : AggregateRoot<Guid>, IAggregateRoot
99
{
1010

1111
}

src/Genocs.Core/Domain/Entities/Auditing/AuditedEntity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
namespace Genocs.Core.Domain.Entities.Auditing;
44

55
/// <summary>
6-
/// A shortcut of <see cref="AuditedEntity{TPrimaryKey}"/> for most used primary key type (<see cref="int"/>).
6+
/// A shortcut of <see cref="AuditedEntity{TPrimaryKey}"/> for most used primary key type (<see cref="Guid"/>).
77
/// </summary>
88
[Serializable]
9-
public abstract class AuditedEntity : AuditedEntity<int>, IEntity
9+
public abstract class AuditedEntity : AuditedEntity<Guid>, IEntity
1010
{
1111

1212
}

src/Genocs.Core/Domain/Entities/Auditing/CreationAuditedEntity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
namespace Genocs.Core.Domain.Entities.Auditing;
66

77
/// <summary>
8-
/// A shortcut of <see cref="CreationAuditedEntity{TPrimaryKey}"/> for most used primary key type (<see cref="int"/>).
8+
/// A shortcut of <see cref="CreationAuditedEntity{TPrimaryKey}"/> for most used primary key type (<see cref="Guid"/>).
99
/// </summary>
1010
[Serializable]
11-
public abstract class CreationAuditedEntity : CreationAuditedEntity<int>, IEntity
11+
public abstract class CreationAuditedEntity : CreationAuditedEntity<Guid>, IEntity
1212
{
1313

1414
}

src/Genocs.Core/Domain/Entities/Auditing/FullAuditedEntity.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
namespace Genocs.Core.Domain.Entities.Auditing;
44

55
/// <summary>
6-
/// A shortcut of <see cref="FullAuditedEntity{TPrimaryKey}"/> for most used primary key type (<see cref="int"/>).
6+
/// A shortcut of <see cref="FullAuditedEntity{TPrimaryKey}"/> for most used primary key type (<see cref="Guid"/>).
77
/// </summary>
88
[Serializable]
9-
public abstract class FullAuditedEntity : FullAuditedEntity<int>, IEntity
9+
public abstract class FullAuditedEntity : FullAuditedEntity<Guid>, IEntity
1010
{
1111

1212
}
@@ -19,12 +19,13 @@ public abstract class FullAuditedEntity : FullAuditedEntity<int>, IEntity
1919
public abstract class FullAuditedEntity<TPrimaryKey> : AuditedEntity<TPrimaryKey>, IFullAudited
2020
{
2121
/// <summary>
22-
/// Is this entity Deleted?
22+
/// it determines if the entity is deleted.
23+
/// Used for soft delete.
2324
/// </summary>
2425
public virtual bool IsDeleted { get; set; }
2526

2627
/// <summary>
27-
/// Which user deleted this entity?
28+
/// It determines the user who deleted this entity.
2829
/// </summary>
2930
public virtual long? DeleterUserId { get; set; }
3031

src/Genocs.Core/Domain/Entities/Entity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
namespace Genocs.Core.Domain.Entities;
44

55
/// <summary>
6-
/// A shortcut of <see cref="Entity{TPrimaryKey}"/> for most used primary key type (<see cref="int"/>).
6+
/// A shortcut of <see cref="Entity{TPrimaryKey}"/> for most used primary key type (<see cref="Guid"/>).
77
/// </summary>
88
[Serializable]
9-
public abstract class Entity : Entity<int>, IEntity
9+
public abstract class Entity : Entity<Guid>, IEntity
1010
{
1111

1212
}
@@ -22,7 +22,7 @@ public abstract class Entity<TPrimaryKey> : IEntity<TPrimaryKey>
2222
/// <summary>
2323
/// Unique identifier for this entity.
2424
/// </summary>
25-
public virtual TPrimaryKey? Id { get; set; }
25+
public virtual TPrimaryKey Id { get; set; }
2626

2727
/// <summary>
2828
/// Checks if this entity is transient (it has not an Id).

src/Genocs.Core/Domain/Entities/IAggregateRoot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Genocs.Core.Domain.Entities;
55

6-
public interface IAggregateRoot : IAggregateRoot<int>, IEntity
6+
public interface IAggregateRoot : IAggregateRoot<Guid>, IEntity
77
{
88

99
}

src/Genocs.Core/Domain/Entities/IEntity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace Genocs.Core.Domain.Entities;
44

55
/// <summary>
6-
/// A shortcut of <see cref="IEntity{TPrimaryKey}"/> for most used primary key type (<see cref="int"/>).
6+
/// A shortcut of <see cref="IEntity{TPrimaryKey}"/> for most used primary key type (<see cref="Guid"/>).
77
/// </summary>
8-
public interface IEntity : IIdentifiable<int>
8+
public interface IEntity : IIdentifiable<Guid>
99
{
1010

1111
}

0 commit comments

Comments
 (0)