Ejemplo n.º 1
0
        public Response Add(string listType, [FromBody] ListModel body)
        {
            try
            {
                List list = null;

                switch (listType)
                {
                case "missing":
                    list = new Missing();
                    break;

                case "shopping":
                    list = new Shopping();
                    break;
                }

                list.Add(body);
                return(new SuccessResponse <ListModel[]>
                {
                    results = list.GetAll()
                });
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }