Beispiel #1
0
        internal IQueryable <ResultDto> GetScoreData()
        {
            var db = new ScoreEngineContext();

            return(db.Results.Select(x => new ResultDto
            {
                Name = x.Name,
                UId = x.UId.ToString(),
                Score = x.Score
            }).OrderByDescending(x => x.Score));
        }
Beispiel #2
0
        internal bool AddScoreData(string name, int score)
        {
            var db = new ScoreEngineContext();

            db.Results.Add(new Models.Result
            {
                Name      = name,
                Score     = score,
                UId       = Guid.NewGuid(),
                AddedDate = DateTime.Now
            });

            db.SaveChanges();

            return(true);
        }