Skip to content

Instantly share code, notes, and snippets.

@ahmetkucukoglu
ahmetkucukoglu / Task.cs
Last active February 23, 2020 17:18
ASP.NET Core ile Event Sourcing 01 - Store - Task.cs
namespace EventSourcingTaskApp.Core
{
using EventSourcingTaskApp.Core.Framework;
public class Task : Aggregate
{
public string Title { get; private set; }
public BoardSections Section { get; private set; }
public string AssignedTo { get; private set; }
public bool IsCompleted { get; private set; }
@ahmetkucukoglu
ahmetkucukoglu / BoardSections.cs
Last active February 23, 2020 17:18
ASP.NET Core ile Event Sourcing 01 - Store - BoardSections.cs
namespace EventSourcingTaskApp.Core
{
public enum BoardSections
{
Open = 1,
InProgress = 2,
Done = 3
}
}
@ahmetkucukoglu
ahmetkucukoglu / TaskAlreadyCreatedException.cs
Last active February 23, 2020 17:18
ASP.NET Core ile Event Sourcing 01 - Store - TaskAlreadyCreatedException.cs
namespace EventSourcingTaskApp.Core.Exceptions
{
using System;
public class TaskAlreadyCreatedException : Exception
{
public TaskAlreadyCreatedException() : base("Task already created.") { }
}
}
@ahmetkucukoglu
ahmetkucukoglu / TaskNotFoundException.cs
Last active February 23, 2020 17:18
ASP.NET Core ile Event Sourcing 01 - Store - TaskNotFoundException.cs
namespace EventSourcingTaskApp.Core.Exceptions
{
using System;
public class TaskNotFoundException : Exception
{
public TaskNotFoundException() : base("Task not found.") { }
}
}
@ahmetkucukoglu
ahmetkucukoglu / TaskCompletedException.cs
Last active February 23, 2020 17:17
ASP.NET Core ile Event Sourcing 01 - Store - TaskCompletedException.cs
namespace EventSourcingTaskApp.Core.Exceptions
{
using System;
public class TaskCompletedException : Exception
{
public TaskCompletedException() : base("Task is completed.") { }
}
}
@ahmetkucukoglu
ahmetkucukoglu / CreatedTask.cs
Last active February 23, 2020 17:17
ASP.NET Core ile Event Sourcing 01 - Store - CreatedTask.cs
namespace EventSourcingTaskApp.Core.Events
{
using System;
public class CreatedTask
{
public Guid TaskId { get; set; }
public string CreatedBy { get; set; }
public string Title { get; set; }
}
@ahmetkucukoglu
ahmetkucukoglu / Task.cs
Last active February 23, 2020 17:17
ASP.NET Core ile Event Sourcing 01 - Store - Task.cs
namespace EventSourcingTaskApp.Core
{
using EventSourcingTaskApp.Core.Events;
using EventSourcingTaskApp.Core.Exceptions;
using EventSourcingTaskApp.Core.Framework;
using System;
public class Task : Aggregate
{
public string Title { get; private set; }
@ahmetkucukoglu
ahmetkucukoglu / AssignedTask.cs
Last active February 23, 2020 17:17
ASP.NET Core ile Event Sourcing 01 - Store - AssignedTask.cs
namespace EventSourcingTaskApp.Core.Events
{
using System;
public class AssignedTask
{
public Guid TaskId { get; set; }
public string AssignedBy { get; set; }
public string AssignedTo { get; set; }
}
@ahmetkucukoglu
ahmetkucukoglu / Task.cs
Last active February 23, 2020 17:17
ASP.NET Core ile Event Sourcing 01 - Store - Task.cs
namespace EventSourcingTaskApp.Core
{
using EventSourcingTaskApp.Core.Events;
using EventSourcingTaskApp.Core.Exceptions;
using EventSourcingTaskApp.Core.Framework;
using System;
public class Task : Aggregate
{
public string Title { get; private set; }
@ahmetkucukoglu
ahmetkucukoglu / MovedTask.cs
Last active February 23, 2020 17:17
ASP.NET Core ile Event Sourcing 01 - Store - MovedTask.cs
namespace EventSourcingTaskApp.Core.Events
{
using System;
public class MovedTask
{
public Guid TaskId { get; set; }
public string MovedBy { get; set; }
public BoardSections Section { get; set; }
}