add additional fields

This commit is contained in:
Vitalick Kovalenko 2023-12-22 22:43:45 +03:00
parent a0a857fd9b
commit a493f11331
2 changed files with 35 additions and 5 deletions

View File

@ -98,7 +98,6 @@ public class MeetingController : ControllerBase
await meeting.SpeackerImage.WriteFileToDirectory();
var meetingWrite = meeting.Adapt<Meeting>();
meetingWrite.SpeackerImage = meeting.SpeackerImage.JoinFileNames();
meetingWrite.Splecializations = meeting.Splecializations.JoinStrings();
await _applicationContext.Meetings.AddAsync(meetingWrite);
await _applicationContext.SaveChangesAsync();
@ -115,8 +114,7 @@ public class MeetingController : ControllerBase
await meeting.SpeackerImage.WriteFileToDirectory();
var meetingWrite = meeting.Adapt<Meeting>();
meetingWrite.SpeackerImage = meeting.SpeackerImage.JoinFileNames();
meetingWrite.Splecializations = meeting.Splecializations.JoinStrings();
var findedMeeting = await _applicationContext.Meetings.FirstAsync<Meeting>(s => s.Id == meeting.Id);
var findedMeeting = await _applicationContext.Meetings.FirstAsync(s => s.Id == meeting.Id);
findedMeeting = meetingWrite;
await _applicationContext.SaveChangesAsync();

View File

@ -19,7 +19,17 @@ public class PostMeetingDto
public IEnumerable<IFormFile> SpeackerImage { get; set; } = null!;
public IEnumerable<string> Splecializations { get; set; } = null!;
public string Splecializations { get; set; } = null!;
public string Type { get; set; } = "онлайн/офлайн";
public string SpeakerTelephone { get; set; } = null!;
public string SpeakerEmail { get; set; } = null!;
public string Tags { get; set; } = null!;
public string VideoUrl { get; set; } = null!;
}
@ -37,7 +47,18 @@ public class PutMeetingDto
public IEnumerable<IFormFile> SpeackerImage { get; set; } = null!;
public IEnumerable<string> Splecializations { get; set; } = null!;
public string Splecializations { get; set; } = null!;
public string Type { get; set; } = "онлайн/офлайн";
public string SpeakerTelephone { get; set; } = null!;
public string SpeakerEmail { get; set; } = null!;
public string Tags { get; set; } = null!;
public string VideoUrl { get; set; } = null!;
}
public class Meeting
@ -55,6 +76,17 @@ public class Meeting
public string SpeackerImage { get; set; } = null!;
public string Splecializations { get; set; } = null!;
public string Type { get; set; } = "онлайн/офлайн";
public string SpeakerTelephone { get; set; } = null!;
public string SpeakerEmail { get; set; } = null!;
public string Tags { get; set; } = null!;
public string VideoUrl { get; set; } = null!;
}