/
oleggbruh
/
TaskTracker
Обзор
Документация
Войти
/
oleggbruh
/
TaskTracker
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
BuildingBlocks/BuildingBlocks.Domain/Entity.cs
22 строки
636 B
olegg
feat: add BuildingBlocks proj
19 окт 2025, 04:07
19 окт 2025, 04:07
6a501f8
Код
Авторство
О чём код?
namespace BuildingBlocks.Domain; public abstract class Entity<TId>(TId id) where TId : notnull { public TId Id { get; protected set; } = id; public override bool Equals(object? obj) => obj is not null && obj is Entity<TId> entity && obj.GetType() == GetType() && Id.Equals(entity.Id); public static bool operator ==(Entity<TId> left, Entity<TId> right) => left.Equals(right); public static bool operator !=(Entity<TId> left, Entity<TId> right) => !left.Equals(right); public override int GetHashCode() => HashCode.Combine(GetType(), Id); }