public IActionResult Contacts(HttpResponse responce, MessageBinding msgBinding) { if (string.IsNullOrEmpty(msgBinding.Sender) || string.IsNullOrEmpty(msgBinding.Subject)) { this.Redirect(responce, "/home/contacts"); return(null); } var msgService = new MessagesService(Data.Data.Context); msgService.AddMessageFromBind(msgBinding); this.Redirect(responce, "/home/index"); return(this.View()); }
public IActionResult Contacts(HttpResponse response, MessageBinding messageBindingModel) { if (string.IsNullOrEmpty(messageBindingModel.Email) || string.IsNullOrEmpty(messageBindingModel.Subject)) { this.Redirect(response, "/home/contacts"); return(null); } MessagesService service = new MessagesService(Data.Data.Context); service.AddMessageFromBind(messageBindingModel); this.Redirect(response, "/home/index"); return(this.View()); }