Example #1
0
        private EditPostDTO MapToEditPostDTO(PostEditViewModel postEditModel)
        {
            var offset = TimeZoneInfo.Local.GetUtcOffset(DateTime.UtcNow);

            postEditModel.StartDate = postEditModel.StartDate.AddHours(offset.TotalHours);
            postEditModel.EndDate   = postEditModel.EndDate.AddHours(offset.TotalHours);

            var editPostDto = PostMapper.ConvertToEditPostDTO(postEditModel);

            editPostDto.Files = MapFilesToDto(postEditModel.Files);

            return(editPostDto);
        }