public PublicMessages AddNewPublicMessage([FromBody] IncomingPublicMessage message) { var result = new PublicMessages(); using (var context = new ChatContext(Context, Configuration)) { result = context.AddNewPublicMessage(message); } return(result); }
public PublicMessages LeaveFeedback([FromBody] IncomingPublicMessage message) { var result = new PublicMessages(); using (var context = new OutboundDetailsContext(Context, Configuration)) { result = context.AddNewFeedback(message); } return(result); }
internal PublicMessages AddNewFeedback(IncomingPublicMessage newMessage) { var message = Context.PublicMessages.Add(new PublicMessages { DateOfMessage = DateTime.Now, SenderName = newMessage.SenderName, MessageContent = newMessage.MessageContent }); Context.SaveChanges(); var association = Context.AssociatedProjectFeedback.Add(new AssociatedProjectFeedback { ProjectId = newMessage.ProjectId, MessageId = message.Entity.Id, Rating = 6 }); Context.SaveChanges(); return(message.Entity); }
internal PublicMessages AddNewPublicMessage(IncomingPublicMessage newMessage) { var message = Context.PublicMessages.Add(new PublicMessages { DateOfMessage = DateTime.Now, SenderName = newMessage.SenderName, MessageContent = newMessage.MessageContent, IsNew = 1 }); Context.SaveChanges(); var association = Context.AssociatedProjectPublicDiscussions.Add(new AssociatedProjectPublicDiscussions { ProjectId = newMessage.ProjectId, PublicMessageId = message.Entity.Id }); Context.SaveChanges(); return(message.Entity); }