This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class PoolType : ValueObject | |
{ | |
public static readonly PoolType Quant = new QuantPoolType(); | |
public static readonly PoolType Verbal = new VerbalPoolType(); | |
public static readonly PoolType IR = new IRPoolType(); | |
public static readonly PoolType Awa = new AwaPoolType(); | |
public static readonly PoolType[] AllTypes = { Quant, Verbal, IR, Awa }; | |
public abstract int Id { get; } | |
public abstract int Size { get; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MethodUnderTest]_[Scenario]_[ExpectedResult] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class DatabaseCommandRetryDecorator<TCommand> : DatabaseRetryDecorator, ICommandHandler<TCommand> | |
where TCommand : ICommand | |
{ | |
private readonly ICommandHandler<TCommand> _handler; | |
public DatabaseCommandRetryDecorator(ICommandHandler<TCommand> handler, Config config) | |
: base(config) | |
{ | |
_handler = handler; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class Messages | |
{ | |
private readonly IServiceProvider _provider; | |
public Messages(IServiceProvider provider) | |
{ | |
_provider = provider; | |
} | |
public void Dispatch(IDomainEvent domainEvent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EditPersonalInfoCommandHandler : ICommandHandler<EditPersonalInfoCommand> | |
{ | |
public Result Handle(EditPersonalInfoCommand command) | |
{ | |
for (int i = 0; ; i++) | |
{ | |
try | |
{ | |
var unitOfWork = new UnitOfWork(_sessionFactory); | |
Student student = unitOfWork.GetStudentById(command.Id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class EnrollCommand : ICommand | |
{ | |
public long StudentId { get; } | |
public string Course { get; } | |
public string Grade { get; } | |
public EnrollCommand(long studentId, string course, string grade) | |
{ | |
if (course == null || grade == null) // Precondition checks | |
throw ArgumentException(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IActionResult EditPersonalInfo([FromBody] EditPersonalInfoCommand command) | |
{ | |
var handler = new EditPersonalInfoCommandHandler(_unitOfWork); | |
Result result = handler.Handle(command); | |
return result.IsSuccess ? Ok() : Error(result.Error); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person : Entity | |
{ | |
public virtual string Name { get; set; } | |
private readonly DocumentContainer _document; | |
public virtual Document Document | |
{ | |
get => _document.Document; | |
set => _document.Document = value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person : Entity | |
{ | |
public virtual string Name { get; set; } | |
public virtual Document Document { get; set; } | |
} | |
public class Document : Entity | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Student : Entity | |
{ | |
public virtual string Name { get; set; } | |
public virtual decimal TotalDebt { get; set; } | |
public virtual IList<Enrollment> Enrollments { get; set; } | |
public virtual IList<SportsActivity> SportsActivities { get; set; } | |
} | |
public class Enrollment : Entity |
NewerOlder