forked from ddrilling/AsbCloudServer
Правки по faq-контроллеру
This commit is contained in:
parent
97476265c2
commit
51a4214062
@ -52,5 +52,15 @@ namespace AsbCloudApp.Data
|
||||
/// Частый вопрос
|
||||
/// </summary>
|
||||
public bool IsFrequently { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Автор вопроса
|
||||
/// </summary>
|
||||
public string AurhorQuestionName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Автор ответа
|
||||
/// </summary>
|
||||
public string? AurhorAnswerName { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,11 @@ namespace AsbCloudInfrastructure.Repository
|
||||
IsFrequently = o.IsFrequently,
|
||||
State = o.State,
|
||||
DateCreatedQuestion = o.DateCreatedQuestion,
|
||||
IdAuthorQuestion = o.IdAuthorQuestion,
|
||||
AurhorQuestionName = o.AuthorQuestion.MakeDisplayName(),
|
||||
AurhorAnswerName = (o.AuthorAnswer != null)
|
||||
? o.AuthorAnswer.MakeDisplayName()
|
||||
: string.Empty,
|
||||
});
|
||||
|
||||
|
||||
@ -74,6 +79,9 @@ namespace AsbCloudInfrastructure.Repository
|
||||
entity.DateCreatedQuestion = entity.DateLastEditedQuestion = DateTimeOffset.UtcNow;
|
||||
entity.CounterQuestion = 1;
|
||||
entity.State = Faq.StateOpened;
|
||||
if (!string.IsNullOrEmpty(entity.Answer))
|
||||
entity.IdAuthorAnswer = entity.IdAuthorQuestion;
|
||||
|
||||
|
||||
db.Faqs.Add(entity);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user