Exemple #1
0
        public async Task <List <ReportRating> > GetAverageRating(ReportRating ratings)
        {
            object tempobj = null;

            if (ratings != null && ratings.StartDate.Year > 1753 && ratings.StartDate.Year < 9999)
            {
                tempobj = new { ratings.StartDate, ratings.EndDate }
            }
            ;
            try
            {
                var result = await connection.QueryAsync <ReportRating>(
                    SpName.AverageRating,
                    tempobj,
                    dbTransaction,
                    commandType : CommandType.StoredProcedure
                    );

                return(result.ToList());
            }
            catch (SqlException ex)
            {
                throw ex;
            }
        }
Exemple #2
0
 public static ReportRatingOutputModel ToOutputModel(ReportRating currentRaiting)
 {
     return(new ReportRatingOutputModel
     {
         CourseName = currentRaiting.CourseName,
         RatingByCourse = currentRaiting.RatingByCourse,
         CountOfStudents = currentRaiting.CountOfStudents
     });
 }