Exemple #1
0
        public async Task <ActionResult <Factoids> > PostFactoids(Factoids factoids)
        {
            _context.Factoids.Add(factoids);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetFactoids", new { id = factoids.Id }, factoids));
        }
Exemple #2
0
        public async Task <IActionResult> PutFactoids(int id, Factoids factoids)
        {
            if (id != factoids.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #3
0
        private void CreateFactoids()
        {
            _image = new FactoidImageMedia();
            _image.NodeDetails.Name = "FactoidImage";
            using (var fs = new System.IO.FileStream(HttpContext.Current.Server.MapPath("/MediaTypes/logoimg.png"), System.IO.FileMode.Open))
            {
                _image.SetMediaFile(fs);
                _image.Persist();
            }
            _factoidFolder = new Factoids();
            _factoidFolder.NodeDetails.Name = "Factoids";
            _factoidFolder.Persist(publish: true);

            CreateFactoid(
                "Man these facts are old",
                "By the year 2012 there will be approximately 17 billion devices connected to the Internet.");

            CreateFactoid(
                "(Of which 870,000 are clickbait listicle slideshow sites)",
                "Domain names are being registered at a rate of more than one million names every month.");

            CreateFactoid(
                "I think this fact is a bit tame, compared to facebook being more populous than China.",
                "MySpace reports over 110 million registered users. Were it a country, it would be the tenth largest, just behind Mexico.");

            CreateFactoid(
                "Love & Marriage",
                "One of every 8 married couples in the US last year met online.");

            CreateFactoid(
                "Blinkin' 'eck",
                "The average computer user blinks 7 times a minute, less than half the normal rate of 20.");

            CreateFactoid(
                "The Mother of All Demos",
                "The first computer mouse was invented by Doug Engelbart in around 1964 and was made of wood. His initial demonstration of the mouse also included the first ever demonstrations of word processing, computer networking and video-conferencing. In the late '60s.");

            CreateFactoid(
                "The Internets Go Quick",
                "While it took the radio 38 years, and the television a short 13 years, it took the World Wide Web only 4 years to reach 50 million users.");

            CreateFactoid(
                "Grace Hopper is Definitely the Coolest Person Ever",
                "Grace Hopper, the inventor of the first ever software compiler and co-creator of COBOL, was also the oldest serviceperson on active duty in the US Navy, retiring at the age of 79 and rank of Rear Admiral.");
        }
        private void CreateFactoids()
        {
            _image = new FactoidImageMedia();
            _image.NodeDetails.Name = "FactoidImage";
            using (var fs = new System.IO.FileStream(HttpContext.Current.Server.MapPath("/MediaTypes/logoimg.png"), System.IO.FileMode.Open))
            {
                _image.SetMediaFile(fs);
                _image.Persist();
            }
            _factoidFolder = new Factoids();
            _factoidFolder.NodeDetails.Name = "Factoids";
            _factoidFolder.Persist(publish: true);

            CreateFactoid(
                "Man these facts are old",
                "By the year 2012 there will be approximately 17 billion devices connected to the Internet.");

            CreateFactoid(
                "(Of which 870,000 are clickbait listicle slideshow sites)",
                "Domain names are being registered at a rate of more than one million names every month.");

            CreateFactoid(
                "I think this fact is a bit tame, compared to facebook being more populous than China.",
                "MySpace reports over 110 million registered users. Were it a country, it would be the tenth largest, just behind Mexico.");

            CreateFactoid(
                "Love & Marriage",
                "One of every 8 married couples in the US last year met online.");

            CreateFactoid(
                "Blinkin' 'eck",
                "The average computer user blinks 7 times a minute, less than half the normal rate of 20.");

            CreateFactoid(
                "The Mother of All Demos",
                "The first computer mouse was invented by Doug Engelbart in around 1964 and was made of wood. His initial demonstration of the mouse also included the first ever demonstrations of word processing, computer networking and video-conferencing. In the late '60s.");

            CreateFactoid(
                "The Internets Go Quick",
                "While it took the radio 38 years, and the television a short 13 years, it took the World Wide Web only 4 years to reach 50 million users.");

            CreateFactoid(
                "Grace Hopper is Definitely the Coolest Person Ever",
                "Grace Hopper, the inventor of the first ever software compiler and co-creator of COBOL, was also the oldest serviceperson on active duty in the US Navy, retiring at the age of 79 and rank of Rear Admiral.");
        }