Skip to content
Prev Previous commit
Next Next commit
fix: remove ReSharper warnings from entities
  • Loading branch information
feO2x committed Jun 13, 2024
commit 4dbd884130198286669ff23c220ed5ebdd6a2ee1
4 changes: 2 additions & 2 deletions Code/Light.SharedCore/Entities/GuidEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public bool Equals(T? other) =>

/// <summary>
/// <para>
/// Sets the Id after the entity is already initialized.
/// Sets the ID after the entity is already initialized.
/// </para>
/// <para>
/// BE CAREFUL: you must not call this method when the ID of your Entity should already be immutable.
Expand Down Expand Up @@ -94,7 +94,7 @@ private static Guid ValidateId(Guid id, string parameterName)
/// Checks if the other instance is of the same entity type and has the same ID as this instance.
/// </summary>
/// <returns>True when both entities are considered equal, else false.</returns>
public override bool Equals(object @object) =>
public override bool Equals(object? @object) =>
@object is T entity && Equals(entity);

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Code/Light.SharedCore/Entities/IMutableId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public interface IMutableId<in T>
/// </para>
/// <para>
/// However, when inserting an entity into a database, the database will usually generate the ID
/// of the entity at this point in time. Updating the ID after the insert is complete is OK and
/// is the usual scenario where this method should be called.
/// of the entity at this point in time. Updating the ID after the insert is OK and
/// this is the usual scenario where this method should be called.
/// </para>
/// </summary>
/// <param name="id">The new ID for the entity.</param>
Expand Down
10 changes: 4 additions & 6 deletions Code/Light.SharedCore/Entities/Int32Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ namespace Light.SharedCore.Entities;
/// Your type that derives from this class. This generic parameter is used for
/// the <see cref="IEquatable{T}" /> implementation.
/// </typeparam>
public abstract class Int32Entity<T> : IEntity<int>,
IEquatable<T>,
IMutableId<int>
public abstract class Int32Entity<T> : IEntity<int>, IEquatable<T>, IMutableId<int>
where T : Int32Entity<T>
{
private int _id;
Expand Down Expand Up @@ -69,11 +67,11 @@ private static int ValidateId(int id, string parameterName)
/// Checks if the other instance is of the same entity type and has the same ID as this instance.
/// </summary>
/// <returns>True when both entities are considered equal, else false.</returns>
public override bool Equals(object @object) =>
public override bool Equals(object? @object) =>
@object is T entity && Equals(entity);

/// <summary>
/// Returns the Id of the entity.
/// Returns the ID of the entity.
/// </summary>
public override int GetHashCode() => Id;

Expand Down Expand Up @@ -111,7 +109,7 @@ public override bool Equals(object @object) =>

/// <summary>
/// <para>
/// Sets the Id after the entity is already initialized.
/// Sets the ID after the entity is already initialized.
/// </para>
/// <para>
/// BE CAREFUL: you must not call this method when the ID of your Entity should already be immutable.
Expand Down
4 changes: 2 additions & 2 deletions Code/Light.SharedCore/Entities/Int64Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static long ValidateId(long id, string parameterName)
/// Checks if the other instance is of the same entity type and has the same ID as this instance.
/// </summary>
/// <returns>True when both entities are considered equal, else false.</returns>
public override bool Equals(object @object) =>
public override bool Equals(object? @object) =>
@object is T entity && Equals(entity);

/// <summary>
Expand Down Expand Up @@ -108,7 +108,7 @@ public override bool Equals(object @object) =>

/// <summary>
/// <para>
/// Sets the Id after the entity is already initialized.
/// Sets the ID after the entity is already initialized.
/// </para>
/// <para>
/// BE CAREFUL: you must not call this method when the ID of your Entity should already be immutable.
Expand Down
2 changes: 1 addition & 1 deletion Code/Light.SharedCore/Entities/StringEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public bool Equals(T? other) =>

/// <summary>
/// <para>
/// Sets the Id after the entity is already initialized.
/// Sets the ID after the entity is already initialized.
/// </para>
/// <para>
/// BE CAREFUL: you must not call this method when the ID of your Entity should already be immutable.
Expand Down