Refactor: Rename DocumentOperator to DocumentService
Updated project and solution files to rename and restructure `DocumentOperator` to `DocumentService`. Modified project references in `DocumentService.API.csproj`, `DocumentService.Application.csproj`, and `DocumentService.Infrastructure.csproj` to reflect the new naming convention. Updated `DocumentService.sln` to remove old project references, add new ones, and adjust configuration and nested project mappings accordingly. This change aligns the project structure with the new naming convention.
This commit is contained in:
41
DocumentService.Domain/Models/ValueObjects/TenantId.cs
Normal file
41
DocumentService.Domain/Models/ValueObjects/TenantId.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace DocumentService.Domain.Models.ValueObjects;
|
||||
|
||||
public sealed class TenantId
|
||||
{
|
||||
public string Value { get; }
|
||||
|
||||
private TenantId(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public static TenantId Create(string value)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value))
|
||||
throw new Common.Exceptions.DomainValidationException("TenantId cannot be empty.");
|
||||
|
||||
if (value.Length > 100)
|
||||
throw new Common.Exceptions.DomainValidationException("TenantId cannot exceed 100 characters.");
|
||||
|
||||
// Normalisierung: Lowercase
|
||||
var normalized = value.Trim().ToLowerInvariant();
|
||||
|
||||
return new TenantId(normalized);
|
||||
}
|
||||
|
||||
public override string ToString() => Value;
|
||||
|
||||
// Equality
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not TenantId other)
|
||||
return false;
|
||||
|
||||
return Value == other.Value;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Value.GetHashCode();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user