Example #1
0
        public IHttpActionResult Create([FromBody] InboxDTO inboxDTO)
        {
            try
            {
                var inboxBusiness = new InboxBusiness();

                var inbox = inboxBusiness.Create(inboxDTO);

                return(Ok(inbox));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Example #2
0
        public IHttpActionResult Post()
        {
            try
            {
                IEnumerable <string> headerValues = Request.Headers.GetValues("UserID");

                var userId = headerValues.FirstOrDefault();

                var inboxBusiness = new InboxBusiness();

                var inboxList = inboxBusiness.GetList(userId);

                return(Ok(inboxList));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }