Exemplo n.º 1
0
        public void AddItemTest()
        {
            readerDB01Entities dbCntxt = new readerDB01Entities();

            Item myItem = new Item();

            myItem.itemName = "half-coin";
            myItem.itemType = "thing";
            myItem.firstMentionBook = 0;
            myItem.firstMentionChapter = 3;

            dbCntxt.Items.Add(myItem);
            dbCntxt.SaveChanges();

            ItemDescription myDesc = new ItemDescription();
            myDesc.bookNumber = 0;
            myDesc.description = "The half-coin given to Grace Beckett by Brother Cy enables her to understand languages other than English.";
            myDesc.itemID = myItem.itemID;

            dbCntxt.ItemDescriptions.Add(myDesc);
            dbCntxt.SaveChanges();
        }
Exemplo n.º 2
0
        public void AddItem()
        {
            worthingtonEntities db = new worthingtonEntities();

            Item myItem = new Item();

            myItem.name = "Travis Wilder";
            myItem.type = 0;
            myItem.firstMentionBook = 0;
            myItem.firstMentionChapter = 0;

            db.Items.Add(myItem);
            db.SaveChanges();

            ItemDescription myDesc = new ItemDescription();
            myDesc.bookNumber = 0;
            myDesc.description = "Travis Wilder is the owner of the Mine Shaft Saloon in Castle City, Colorado. He is tall, lean, and 33 years old. Travis has a beard, pale blond hair, and he wears wire-rimmed glasses.";
            myDesc.ItemID = myItem.ItemID;

            db.ItemDescriptions.Add(myDesc);
            db.SaveChanges();
        }