示例#1
0
        // GET api/<controller>
        public LibraryResponse Get()
        {
            LibraryResponse response = new LibraryResponse();

            response.Series = Library.Series().ToList();
            return(response);
        }
示例#2
0
        // POST api/<controller>
        public LibraryResponse Post([FromBody] LibraryRequest request)
        {
            LibraryResponse response = new LibraryResponse();

            if (request.Series != null)
            {
                foreach (var serie in request.Series)
                {
                    Library.Add(serie);
                }
                this.Library.Commit();
            }
            response.Series = Library.Series().ToList();
            return(response);
        }