From 91d04255af7ccaa05fd0e3fe4941c5dd42f7d90c Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Wed, 12 May 2021 00:17:58 +0300 Subject: [PATCH] Add StartTime and EndTime for edit event page --- .../Events/UpdateEventDto.cs | 8 ++++++++ src/EventHub.Application/Events/EventAppService.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs b/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs index 459816b..82aae30 100644 --- a/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs +++ b/src/EventHub.Application.Contracts/Events/UpdateEventDto.cs @@ -16,6 +16,14 @@ namespace EventHub.Events [CanBeNull] public byte[] CoverImageContent { get; set; } + + [Required] + [DataType(DataType.DateTime)] + public DateTime StartTime { get; set; } + + [Required] + [DataType(DataType.DateTime)] + public DateTime EndTime { get; set; } public bool IsOnline { get; set; } diff --git a/src/EventHub.Application/Events/EventAppService.cs b/src/EventHub.Application/Events/EventAppService.cs index 09b439d..b267baa 100644 --- a/src/EventHub.Application/Events/EventAppService.cs +++ b/src/EventHub.Application/Events/EventAppService.cs @@ -248,7 +248,7 @@ namespace EventHub.Events @event.SetTitle(input.Title); @event.SetDescription(input.Description); @event.Language = input.Language; - + @event.SetTime(input.StartTime, input.EndTime); await _eventManager.SetCapacityAsync(@event, input.Capacity); if (input.CoverImageContent != null && input.CoverImageContent.Length > 0)