/// <summary> /// Delete a record from the iguana database by id /// </summary> /// <param name="id">id of iguana record</param> public void DeleteById(int id) { Iguana iguana = GetById(id); Db.Iguanas.Remove(iguana); Db.SaveChanges(); }
private bool IguanaInView() { if (fov.hasTargetInView()) { Iguana iguana = fov.getTarget().GetComponent <Iguana>(); return(!iguana.isInWell()); } return(false); }
public IActionResult AddSighting(Iguana iguana) { //https://www.codegrepper.com/code-examples/csharp/how+to+convert+iformfile+to+byte+array+c%23 if (ModelState.IsValid) { string filePath = string.Format("{0}{1}", iguana.Directory, iguana.ImageFileName); BlobHttpHeaders blobHttpHeader = new BlobHttpHeaders(); blobHttpHeader.ContentType = "image/jpeg"; _azureBlobService.UploadFileToStorage(iguana.ImageData, filePath, blobHttpHeader); _iguanaTrackerService.Add(iguana); } return(RedirectToAction("Index")); }
public void testIguana() { Iguana george = new Iguana() { numHorns = 1 }; string expected = "I'm just better than you"; george.beCool(); george.eat(); Assert.Equal(expected, george.beCool()); Assert.True(george.likesFrank); //next assert checks inheritance on reptile Assert.False(george.Poisonous); //next assert checks inheritance from lizard Assert.Equal(1, george.numHorns); }
static void Main(string[] args) { var jericho = new Snake("Jericho", "Boa Constrictor"); jericho.FeedReptile(); jericho.Speak(); jericho.Slither(); var rogue = new Iguana("Rogue", "Green Iguana"); rogue.FeedReptile(); rogue.Speak(); rogue.Dislike(); var snuggles = new Alligator("Snuggles", "American Alligator"); snuggles.FeedReptile(); snuggles.Speak(); snuggles.DeathRoll(); var fgfc820 = new Industrial("FGFC820", "Aggrotech") { AlbumNumber = 10 }; fgfc820.RockOut("Bridgestone Arena"); fgfc820.CheckAlbums(); fgfc820.Bringit(); var vnvNation = new Industrial("VNV Nation", "EBM") { AlbumNumber = 20 }; vnvNation.RockOut("Exit/In"); vnvNation.CheckAlbums(); vnvNation.Bringit(); var bach = new Classical("Johan Sebestian Bach", "Baroque"); bach.Encore(); var theGrapesOfWrath = new Novel("The Grapes of Wrath", 525, "John Steinbeck") { HaveRead = true }; theGrapesOfWrath.Open(); theGrapesOfWrath.Read(); var braveNewWorld = new Novel("Brave New World", 452, "Aldous Huxley") { HaveRead = false }; braveNewWorld.Read(); var verdi = new PictureBook("Verdi", 15, "Janell Cannon"); verdi.Read(); var worldOfWarcraft = new VideoGames("World of Warcraft", new DateTime(2004, 11, 24)) { Developer = "Blizzard", GameGenre = GameGenre.MMO }; worldOfWarcraft.Play(); worldOfWarcraft.Return(); var doom = new VideoGames("Doom", new DateTime(1993, 12, 10)) { Developer = "id Software", GameGenre = GameGenre.Shooter }; doom.Play(); doom.Return(); Console.ReadKey(); }
/// <summary> /// Add a new record to the iguana table in the database /// </summary> /// <param name="item">New iguana record</param> public void Add(Iguana item) { Db.Add(item); Db.SaveChanges(); }
public void Post([FromBody] Iguana item) { _iguanaTrackerService.Add(item); }