Пример #1
0
        public Bookmark CreateBookmark(Bookmark bookmark)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            _context.Bookmarks.Add(bookmark);
            _context.SaveChanges();

            return(bookmark);
        }
Пример #2
0
 public Category CreateCategory(Category category)
 {
     _readLaterDataContext.Add(category);
     _readLaterDataContext.SaveChanges();
     return(category);
 }