Exemplo n.º 1
0
        public dynamic Post(Communication communication)
        {
            try
            {
                _context.Communications.Add(communication);
                _context.SaveChanges();

                return(new { success = true, data = communication });
            }
            catch (Exception e)
            {
                return(new { success = false, error = e });
            }
        }
Exemplo n.º 2
0
        public async Task <dynamic> Post(Contact contact)
        {
            try
            {
                _context.Contacts.Add(contact);
                _context.SaveChanges();

                await sendEmail(contact);

                return(new { success = true, data = contact });
            }
            catch (Exception e)
            {
                return(new { success = false, error = e });
            }
        }