public SectionArchiveResponseDTO Create(CreateSectionArchiveRequestDTO requestDTO) { SectionArchive sectionArchive = new SectionArchive() { sectionUUID = requestDTO.sectionUUID, name = requestDTO.name, description = requestDTO.description, visible = requestDTO.visible, creationDate = requestDTO.creationDate, course = new Course() { uuid = requestDTO.courseUUID }, moderator = new User() { uuid = requestDTO.moderatorUUID }, changeDate = requestDTO.changeDate }; sectionArchive = this._queryExecutor.Execute <SectionArchive>(DatabaseConsts.USER_SCHEMA, this._sqlCommands.CREATE_ARCHIVE(sectionArchive), this._modelMapper.MapToSectionArchive); return(this._autoMapper.Map <SectionArchiveResponseDTO>(sectionArchive)); }
public string CREATE_ARCHIVE(SectionArchive sectionArchive) { return($"insert into SAUP_SECTION.SectionArchive (sectionUUID, name, description, visible, creationDate, courseUUID, moderatorUUID, changeDate) " + $"values ('{sectionArchive.sectionUUID}','{sectionArchive.name}', '{sectionArchive.description}', '{sectionArchive.visible}', '{sectionArchive.creationDate}', '{sectionArchive.course.uuid}', '{sectionArchive.moderator.uuid}', '{sectionArchive.changeDate}');"); }