예제 #1
0
        static void Main(string[] args)
        {
            ListNode a = new ListNode(1);
            ListNode b = new ListNode(1);
            //ListNode b = a;

            Dictionary <object, object> d = new Dictionary <object, object>();

            d.Add(a, a);
            d.Add(b, b);

            if (a == b)
            {
                Console.WriteLine();
            }

            var h   = a.GetHashCode();
            var h1  = a.GetHashCode();
            var h2  = b.GetHashCode();
            var res = d[a].Equals(d[b]);

            BookTest bt = new BookTest();

            bt.shouldTwoBookWithSameNameAuthor_return_equal();
        }
        public async Task <IActionResult> PutBookTest(int id, BookTest bookTest)
        {
            if (id != bookTest.BookId)
            {
                return(BadRequest());
            }

            _context.Entry(bookTest).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BookTestExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <ActionResult <BookTest> > PostBookTest(BookTest bookTest)
        {
            _context.BookTest.Add(bookTest);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBookTest", new { id = bookTest.BookId }, bookTest));
        }
예제 #4
0
 public int BookTest(BookTest bookTest)
 {
     //labEntity.BookTests.Add(bookTest);
     //labEntity.SaveChanges();
     lstBooktest = new List <BookTest>();
     lstBooktest.Add(bookTest);
     return(0);
 }
        static void Main(string[] args)
        {
            Book     book = new Book();
            BookTest Book = new BookTest();

            book.title  = "Goosebumps: Welcome to Camp Nightmare";
            book.author = "R.L Stein";
            book.year   = "1993";


            book.Display();
        }