Ejemplo n.º 1
0
        public static bool InsertHiScore(FallDown_HiScore hiScore)
        {
            bool result = false;

            try
            {
                using (var context = new CarloniusEntities())
                {
                    context.FallDown_HiScore.Add(hiScore);
                    context.SaveChanges();
                    result = true;
                }
            }
            catch (Exception ex)
            {
                HandleException(ex, "InsertHiScore");
                result = false;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static IEnumerable <FallDown_GetNHiScores_Result> GetScores(int n)
        {
            List <FallDown_GetNHiScores_Result> hiScores = new List <FallDown_GetNHiScores_Result>();

            try
            {
                using (var context = new CarloniusEntities())
                {
                    ObjectResult <FallDown_GetNHiScores_Result> resultSet  = context.FallDown_GetNHiScores(n);
                    List <FallDown_GetNHiScores_Result>         resultList = (from scores in resultSet select scores).ToList();
                    foreach (FallDown_GetNHiScores_Result result in resultList)
                    {
                        hiScores.Add(result);
                    }
                }
            }
            catch (Exception ex)
            {
                HandleException(ex, "GetScores");
            }
            return(hiScores);
        }