CreateLanguageCommand

This commit is contained in:
2025-09-01 22:42:10 +04:30
parent 746b6159e4
commit fc6d32bad7
17 changed files with 151 additions and 49 deletions
@@ -1,12 +1,14 @@
namespace VizhTalk.BuildingBlocks.Domain;
using System.Linq.Expressions;
public interface IRepositoryBase<T,TId>
namespace VizhTalk.BuildingBlocks.Domain;
public interface IRepositoryBase<T, TId>
where T : Entity<TId> where TId : ITypeIdValueBase
{
Task<T> AddAsync(T entity,CancellationToken cancellationToken = default);
Task UpdateAsync(T entity,CancellationToken cancellationToken = default);
Task DeleteAsync(T entity,CancellationToken cancellationToken = default);
Task DeleteById(TId id,CancellationToken cancellationToken = default);
Task<T?> GetById(TId id,CancellationToken cancellationToken = default);
Task<T> AddAsync(T entity, CancellationToken cancellationToken = default);
Task UpdateAsync(T entity, CancellationToken cancellationToken = default);
Task DeleteAsync(T entity, CancellationToken cancellationToken = default);
Task DeleteById(TId id, CancellationToken cancellationToken = default);
Task<T?> GetById(TId id, CancellationToken cancellationToken = default);
Task<bool> Exists(Expression<Func<T,bool>> predicate, CancellationToken cancellationToken = default);
}
@@ -20,9 +20,7 @@ public abstract class TypedIdValueBase<T> : IEquatable<TypedIdValueBase<T>> , IT
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
{
return false;
}
return obj is TypedIdValueBase<T> other && Equals(other);
}
@@ -34,13 +32,12 @@ public abstract class TypedIdValueBase<T> : IEquatable<TypedIdValueBase<T>> , IT
public bool Equals(TypedIdValueBase<T>? other)
{
if(other == null)
return false;
return EqualityComparer<T>.Default.Equals(this.Value, other.Value);
}
public bool Equals(ITypeIdValueBase? other)
{
throw new NotImplementedException();
}
public static bool operator ==(TypedIdValueBase<T>? obj1, TypedIdValueBase<T>? obj2)
{