правочка
This commit is contained in:
parent
0fc71da489
commit
3a9732fc22
@ -38,7 +38,7 @@ namespace CarRepairShopDatabaseImplement.Implements
|
||||
using var context = new CarRepairShopDatabase();
|
||||
model.ClientId = context.Clients.FirstOrDefault(x => x.Email.Equals(model.SenderName))?.Id;
|
||||
var message = MessageInfo.Create(model);
|
||||
if(message == null) return null;
|
||||
if(message == null || context.Messages.Any(x => x.MessageId.Equals(model.MessageId))) return null;
|
||||
context.Messages.Add(message);
|
||||
context.SaveChanges();
|
||||
return message.GetViewModel;
|
||||
|
Loading…
Reference in New Issue
Block a user