Пример #1
0
    /// <summary>
    /// Gets the 4 and 3 words phrases
    /// </summary>
    /// <param name="article">Which article to extract from</param>
    /// <returns>List of phrases with 3 or 4 words</returns>
    protected List <string> GetLongPhrases(ExampleArticles article)
    {
        string        stopListPath   = MapPath(".") + "/Files/SmartStoplist.txt";
        TextCheating  txtCheats      = new TextCheating();
        string        articleText    = new TextCheating().GetArticleText(ExampleArticles.HackersTopologyMatterGeography);
        Rake          rake           = new Rake(stopListPath, 1, 4, 2);
        var           resultsDict    = rake.Run(articleText);
        List <string> fourWordsList  = new List <string>();
        List <string> threeWordsList = new List <string>();

        foreach (string phrase in resultsDict.Keys)
        {
            int numOfWords = phrase.Split(' ').Length;
            if (numOfWords == 4)
            {
                fourWordsList.Add(phrase);
            }
            else if (numOfWords == 3)
            {
                threeWordsList.Add(phrase);
            }
        }
        List <string> FinalKeywordsCandidates = new List <string>();

        FinalKeywordsCandidates.AddRange(fourWordsList);
        FinalKeywordsCandidates.AddRange(threeWordsList);
        return(FinalKeywordsCandidates);
    }
Пример #2
0
    protected void DisplayResults()
    {
        //get rake and text reults
        TextCheating cheat        = new TextCheating();
        string       stopListPath = MapPath(".") + "/Files/SmartStoplist.txt";
        Rake         rake         = new Rake(stopListPath, 1, 20, 1);

        sample1.Text = cheat.Sample1();
        var results = rake.Run(cheat.Sample1());

        //calculate results vs expected
        var resultsString = results.Keys.ToArray();
        var expected      = cheat.ExpectedSample1();
        var match         = KeywordsFound(resultsString, expected);
        var topResults    = TopResults(results);
        var missed        = KeywordsMissed(resultsString, expected);
        var newKeywords   = NewKeywords(topResults, expected);

        //place in form

        lbl_expected.Text = ReadyForDisplayLabel(expected, "Expected:");
        lbl_newWords.Text = ReadyForDisplayLabel(newKeywords, "New Keywords:");
        lbl_match.Text    = ReadyForDisplayLabel(match, "Matches:");
        lbl_misses.Text   = ReadyForDisplayLabel(missed, "Missed Keywords:");
    }
Пример #3
0
 private void ValidarRake(Rake rake)
 {
     if (!rake.Validar)
     {
         AdicionarNotificacao(rake.Notificacoes);
     }
 }
Пример #4
0
        public RakeDetails(Rake _rake)
        {
            InitializeComponent();
            rake = _rake;
            lblCreatedOn.Text = string.Format("Created On: {0} {1}", rake.CreatedOn.ToShortTimeString(), rake.CreatedOn.ToShortDateString());

            lblDeadline.Text      = string.Format("Placement Deadline: {0} {1}", rake.PlacementDeadline.ToShortTimeString(), rake.PlacementDeadline.ToShortDateString());
            WagonList.ItemsSource = rake.Wagons;

            switch (rake.Status)
            {
            case Rake.RakeStatus.Pending:
                btnPlace.IsVisible = true;
                break;

            case Rake.RakeStatus.PlacedLate:
                lblPlacedOn.Text        = string.Format("Actual Placement: {0} {1}", rake.PlacementCompletedOn.ToShortTimeString(), rake.PlacementCompletedOn.ToShortDateString());
                lblPlacedOn.IsVisible   = true;
                lblLateReason.Text      = "Late Reason: " + rake.LateReason;
                lblLateReason.IsVisible = true;
                break;

            default:
                lblPlacedOn.Text        = string.Format("Actual Placement: {0} {1}", rake.PlacementCompletedOn.ToShortTimeString(), rake.PlacementCompletedOn.ToShortDateString());
                lblPlacedOn.IsVisible   = true;
                lblLateReason.Text      = "Place on Time";
                lblLateReason.IsVisible = true;
                break;
            }
        }
Пример #5
0
    protected void RunRakeWithUserParams()
    {
        string stopListPath    = MapPath(".") + "/Files/SmartStoplist.txt";
        int    minCharLength   = int.Parse(minCharLengthDDL.SelectedValue);
        int    maxWordsLength  = int.Parse(maxWordsLengthDDL.SelectedValue);
        int    minWordsFreq    = int.Parse(minKeywordFreqDDL.SelectedValue);
        int    amountOfResults = int.Parse(topTB.Text);
        Rake   rake            = new Rake(stopListPath, minCharLength, maxWordsLength, minWordsFreq);

        string text    = File.ReadAllText(articleDDL.SelectedValue);
        var    results = rake.Run(text);

        int minRating;

        if (minKeywordRatingDDL.SelectedValue.ToLower() == "optional")
        {
            minRating = 0;
        }
        else
        {
            minRating = int.Parse(minKeywordRatingDDL.SelectedValue);
        }

        // var topResults = results.OrderByDescending(pair => pair.Value).Take(5);
        //var topResults = GetTopResults(results, amountOfResults);

        Dictionary <string, double> f = GetTopResults2(results, amountOfResults);

        lbl_res.Text = ToLabelString(f);
    }
Пример #6
0
        private string GetBuyinString(string currencySymbol, string seperatorCharacter, IFormatProvider format)
        {
            string prizePoolString = (PrizePool != Math.Round(PrizePool)) ? PrizePool.ToString("N2", format) : PrizePool.ToString("N0", format);
            string rakeString      = (Rake != Math.Round(Rake)) ? Rake.ToString("N2", format) : Rake.ToString("N0", format);

            return(string.Format("{0}{1}{3}{0}{2}", currencySymbol, prizePoolString, rakeString, seperatorCharacter));
        }
Пример #7
0
        public ActionResult DeleteConfirmed(int id)
        {
            Rake rake = db.Rakes.Find(id);

            db.Rakes.Remove(rake);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #8
0
 public ActionResult Edit([Bind(Include = "Id,GameId,PersonId,Amount,DateTime")] Rake rake)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rake).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.GameId   = new SelectList(db.Games, "Id", "Name", rake.GameId);
     ViewBag.PersonId = new SelectList(db.Persons, "Id", "Name", rake.PersonId);
     return(View(rake));
 }
Пример #9
0
        public ActionResult Create([Bind(Include = "Id,GameId,PersonId,Amount")] Rake rake)
        {
            if (ModelState.IsValid)
            {
                db.Rakes.Add(rake);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.GameId   = new SelectList(db.Games, "Id", "Name", rake.GameId);
            ViewBag.PersonId = new SelectList(db.Persons, "Id", "Name", rake.PersonId);
            return(View(rake));
        }
Пример #10
0
        // GET: Rakes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Rake rake = db.Rakes.Find(id);

            if (rake == null)
            {
                return(HttpNotFound());
            }
            return(View(rake));
        }
Пример #11
0
        private string GetBuyinString(string currencySymbol, string seperatorCharacter, IFormatProvider format)
        {
            string prizePoolString = (PrizePoolValue != Math.Round(PrizePoolValue)) ? PrizePoolValue.ToString("N2", format) : PrizePoolValue.ToString("N0", format);
            string rakeString      = (Rake != Math.Round(Rake)) ? Rake.ToString("N2", format) : Rake.ToString("N0", format);

            if (IsKnockout)
            {
                string knockoutString = (KnockoutValue != Math.Round(KnockoutValue)) ? KnockoutValue.ToString("N2", format) : KnockoutValue.ToString("N0", format);

                return(string.Format("{0}{1}{4}{0}{3}{4}{0}{2}", currencySymbol, prizePoolString, rakeString, knockoutString, seperatorCharacter));
            }

            return(string.Format("{0}{1}{3}{0}{2}", currencySymbol, prizePoolString, rakeString, seperatorCharacter));
        }
Пример #12
0
        // GET: Rakes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Rake rake = db.Rakes.Find(id);

            if (rake == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GameId   = new SelectList(db.Games, "Id", "Name", rake.GameId);
            ViewBag.PersonId = new SelectList(db.Persons, "Id", "Name", rake.PersonId);
            return(View(rake));
        }
Пример #13
0
        public void Just_Looking_At_Some_Results()
        {
            var text =
                @"Iraq has launched the long-awaited offensive to expel Islamic State from its second largest city Mosul and Australian personnel and aircraft will certainly be involved in support operations.

            But Defence won't say just what or how.

            'Defence will not discuss specific details for operational security reasons,' a defence spokesman said.

            Defence Minister Marise Payne declined to comment on operational details, saying it would take time and she was awaiting updates.

            She also declined to elaborate on predictions of civilian casualties.

            'I don't think my conjecture on rates of casualties or otherwise would be helpful at this point,' she said.

            Australia has a substantial force in the Middle East, extensively involved in the fight against Islamic State.

            The six F/A-18 Hornets of the RAAF Air Task Group will operate as part of the coalition air contingent, hitting IS targets in the city.

            The RAAF KC-30A refueling aircraft will support the air campaign, as will the E-7A Wedgetail airborne warning and control aircraft.

            Closest to Australian boots on the ground could be the 80-stong special operations task group whose members have advised and mentored Iraq's elite Counter-Terrorism Service.

            This unit, referred to as the Golden Division, played a key role in the fight to retake Ramadi.

            Iraqi infantry trained by the 300 Australians and 100 New Zealanders of Task Group Taji will be in the thick of the fighting.

            Another 30 Australian personnel are embedded in coalition headquarters in Baghdad.

            US Lieutenant General Stephen Townsend, commander of the coalition taskforce, said the operation to regain control of Mosul would likely continue for weeks, possibly longer.

            He said Iraq was supported by a wide range of coalition capabilities, including air support, artillery, intelligence, advisors and forward air controllers.

            'But to be clear, the thousands of ground combat forces who will liberate Mosul are all Iraqis,' he said in a statement.

            'This may prove to be a long and tough battle, but the Iraqis have prepared for it and we will stand by them.'";

            var rake = new Rake(minCharLength: 4, maxWordsLength: 12);

            var result = rake.Run(text);

            Assert.IsNotNull(result);

            var result2 = rake.Run(string.Join("|", result.Select(pair => pair.Key)));

            Assert.IsNotNull(result2);
        }
Пример #14
0
 public ReportPlace(Rake _rake)
 {
     InitializeComponent();
     FillPicker();
     rake = _rake;
     rake.PlacementCompletedOn = DateTime.Now;
     if (rake.PlacementCompletedOn > rake.PlacementDeadline)
     {
         pckLateReason.IsVisible = true;
         IsLate = true;
     }
     else
     {
         IsLate = false;
         pckLateReason.IsVisible = false;
     }
 }
Пример #15
0
        public Rake Incluir(RakeRequest request, string usuarioCadastro)
        {
            var novoRake = new Rake(request.DataRetirada, request.Valor, usuarioCadastro);

            ValidarRake(novoRake);
            if (Validar)
            {
                bool rakeRetirado = repositorio.VerificarRakeRetirado(request.Id);
                if (!rakeRetirado)
                {
                    return(repositorio.Incluir(novoRake));
                }
                else
                {
                    AdicionarNotificacao("Rake", RakeMensagem.Retirado);
                }
            }
            return(null);
        }
Пример #16
0
        public void Rake_Sort_Of_Works()
        {
            const string text = @"Compatibility of systems of linear constraints over the set of natural numbers. 
Criteria of compatibility of a system of linear Diophantine equations, strict inequations, and nonstrict inequations are considered. 
Upper bounds for components of a minimal set of solutions and algorithms of construction of minimal generating sets of solutions for all types of systems are given. 
These criteria and the corresponding algorithms for constructing a minimal supporting set of solutions can be used in solving all the considered types of systems and systems of mixed types.";

            var rake = new Rake();

            var result = rake.Run(text);

            Assert.IsNotNull(result);

            // from https://www.airpair.com/nlp/keyword-extraction-tutorial

            // expected was

            /*
             * Keyword:  minimal generating sets , score:  8.66666666667
             * Keyword:  linear diophantine equations , score:  8.5
             * Keyword:  minimal supporting set , score:  7.66666666667
             * Keyword:  minimal set , score:  4.66666666667
             * Keyword:  linear constraints , score:  4.5
             * Keyword:  upper bounds , score:  4.0
             * Keyword:  natural numbers , score:  4.0
             * Keyword:  nonstrict inequations , score:  4.0
             */

            Assert.AreEqual("minimal generating sets", result.Skip(0).First().Key);
            Assert.AreEqual("linear diophantine equations", result.Skip(1).First().Key);
            Assert.AreEqual("minimal supporting set", result.Skip(2).First().Key);
            Assert.AreEqual("minimal set", result.Skip(3).First().Key);
            Assert.AreEqual("linear constraints", result.Skip(4).First().Key);

            // we then hit a few that are scored the same and the order is slightly different
            //Assert.AreEqual("upper bounds", result.Skip(5).First().Key);
            //Assert.AreEqual("natural numbers", result.Skip(6).First().Key);
            //Assert.AreEqual("nonstrict inequations", result.Skip(7).First().Key);

            // but the score is OK so we are green
            Assert.AreEqual(4.0, result["upper bounds"]);
        }
Пример #17
0
    protected void BigRakeTestAttempt()
    {
        string   stopListPath   = MapPath(".") + "/Files/SmartStoplist.txt";
        int      minCharLength  = 1;
        int      maxWordsLength = 1;
        int      minWordsFreq   = 1;
        string   articleTitle   = articleDDL.Items[articleDDL.SelectedIndex].ToString();
        string   text           = File.ReadAllText(articleDDL.SelectedValue);
        Rake     rake;
        RAKETest rt = new RAKETest();



        int id = 1;
        List <Dictionary <string, double> > allResults = new List <Dictionary <string, double> >();

        for (int i = 1; i < 4; i++)
        {
            for (int j = 1; j < 5; j++)
            {
                for (int k = 1; k < 6; k++)
                {
                    maxWordsLength = i;
                    minCharLength  = j;
                    minWordsFreq   = k;
                    rake           = new Rake(stopListPath, minCharLength, maxWordsLength, minWordsFreq);
                    var results = rake.Run(text);
                    var temp    = GetTopResults2(results, 30);
                    allResults.Add(temp);


                    rt.AddTest(new RAKETest(temp, (id), minCharLength, maxWordsLength, minWordsFreq, articleTitle));

                    id++;
                }
            }
        }

        //Console.WriteLine(allResults);
    }
Пример #18
0
    protected List <string> GetOneWordKeywords(ExampleArticles article)
    {
        int minCharLength = 1; //I f**k up when i change this
        int maxWordsCount = 2; //we need one word, but how does that effect our scoring?
        int minWordFreq   = 7; //When i do 3, i miss most of the 2 word phrases found by scholar

        string        stopListPath = MapPath(".") + "/Files/SmartStoplist.txt";
        TextCheating  txtCheats    = new TextCheating();
        string        articleText  = new TextCheating().GetArticleText(ExampleArticles.HackersTopologyMatterGeography);
        Rake          rake         = new Rake(stopListPath, minCharLength, maxWordsCount, minWordFreq);
        var           resultsDict  = rake.Run(articleText);
        List <string> oneWordList  = new List <string>();

        foreach (string phrase in resultsDict.Keys)
        {
            int numOfWords = phrase.Split(' ').Length;
            if (numOfWords == 1)
            {
                oneWordList.Add(phrase);
            }
        }
        return(oneWordList);
    }
Пример #19
0
    protected void submitBTN_Click(object sender, EventArgs e)
    {
        string stopListPath = MapPath(".") + "/Files/SmartStoplist.txt";
        Rake   rake         = new Rake(stopListPath, 1, 4, 1);
        string text         = textTB.Text;
        var    results      = rake.Run(text);

        string res     = "";
        int    counter = 1;

        foreach (var item in results.Keys)
        {
            if (results[item] >= 7)
            {
                res += (counter++) + ") " + item + ", " + results[item].ToString();
                if (results.Keys.Last() != item)
                {
                    res += "<br>";
                }
            }
        }

        lbl_results.Text = res;
    }
Пример #20
0
        public Dictionary <string, double> GetRakeKeywords(int length)
        {
            Rake generator = new Rake(ToolInfo.root + "\\SMARTstopset.txt", 3, length, 3);

            return(generator.Run(this.BuildBigString(this.GetList())));
        }
Пример #21
0
    protected IList <string> CompareRake(ExampleArticles article, KeywordResources resource = KeywordResources.ALL, int minCharLength = 1, int maxWordsLength = 5, double minWordFreq = 1)
    {
        string         stopListPath = MapPath(".") + "/Files/SmartStoplist.txt";
        TextCheating   txtCheats    = new TextCheating();
        IList <string> keywords     = txtCheats.ExpectedKeywords(ExampleArticles.HackersTopologyMatterGeography, KeywordResources.ALL);
        Rake           rake         = new Rake(stopListPath, minCharLength, maxWordsLength, minWordFreq);
        var            resultsDict  = rake.Run(txtCheats.GetArticleText(ExampleArticles.HackersTopologyMatterGeography));
        var            results      = resultsDict.Keys.ToList();


        List <string> fullMatch = new List <string>();
        Dictionary <string, string> resultsInKeywords = new Dictionary <string, string>();
        Dictionary <string, string> keywordsInResults = new Dictionary <string, string>();
        List <string> missedYouNoob = new List <string>();

        for (int i = 0; i < keywords.Count; i++)
        {
            bool match = false;
            for (int j = 0; j < results.Count; j++)
            {
                string _res     = results[j].ToLower().Trim();
                string _keyword = keywords[i].ToLower().Trim();
                if (_res == _keyword)
                {
                    match = true;
                    if (!fullMatch.Contains(_keyword))
                    {
                        fullMatch.Add(_keyword);
                    }
                }
                else if (_res.Contains(" " + _keyword + " "))
                {
                    if (!keywordsInResults.Keys.Contains(_keyword))
                    {
                        keywordsInResults.Add(_keyword, _res);
                    }
                }
                else if (_keyword.Contains(" " + _res + " "))
                {
                    if (!resultsInKeywords.Keys.Contains(_res))
                    {
                        resultsInKeywords.Add(_res, _keyword);
                    }
                }
            }
            if (!match)
            {
                missedYouNoob.Add(keywords[i]);
            }
        }
        var t = "";
        Dictionary <string, double> fullMatchScores = new Dictionary <string, double>();

        for (int i = 0; i < fullMatch.Count; i++)
        {
            fullMatchScores.Add(fullMatch[i], resultsDict[fullMatch[i]]);
            t += fullMatch[i] + "\r\n";
        }

        return(fullMatch);
    }
Пример #22
0
 public AddRake()
 {
     InitializeComponent();
     rake = new Rake();
     WagonList.ItemsSource = rake.Wagons;
 }
Пример #23
0
        private static void CreateRake(ApplicationDbContext dbContext)
        {
            var rake = new Rake()
            {
                EndDate = new DateTime(2017, 2, 19)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();

            var rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)29.99,
                RakeId  = rake.Id
            };

            var rakeDetail2 = new RakeDetail()
            {
                Percent = 10,
                Value   = 999,
                RakeId  = rake.Id
            };


            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.RakeDetails.Add(rakeDetail2);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 2, 18, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();

            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();


            rake = new Rake()
            {
                EndDate = new DateTime(2017, 4, 1, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();

            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 6, 9, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();

            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)29.99,
                RakeId  = rake.Id
            };

            rakeDetail2 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.RakeDetails.Add(rakeDetail2);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 9, 3, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();


            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)29.99,
                RakeId  = rake.Id
            };

            rakeDetail2 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.RakeDetails.Add(rakeDetail2);
            dbContext.SaveChanges();


            rake = new Rake()
            {
                EndDate = new DateTime(2017, 9, 23, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 9, 24, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 9, 29, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 10, 8, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 10, 14, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 10, 22, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 11, 5, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 11, 11, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2017, 11, 15, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2018, 4, 6, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();


            rake = new Rake()
            {
                EndDate = new DateTime(2018, 4, 7, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2018, 5, 31, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = new DateTime(2018, 6, 19, 23, 59, 59)
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 20,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();

            rake = new Rake()
            {
                EndDate = DateTime.MaxValue
            };

            dbContext.Rakes.Add(rake);
            dbContext.SaveChanges();



            rakeDetail1 = new RakeDetail()
            {
                Percent = 10,
                Value   = (decimal)999,
                RakeId  = rake.Id
            };

            dbContext.RakeDetails.Add(rakeDetail1);
            dbContext.SaveChanges();
        }