예제 #1
0
        public async Task <IMonthDao> Get(int id)
        {
            var command = new GetMonthByIdCommand {
                monthId = id
            };
            IMonthDao month = await _monthHandler.HandleAsync(command).ConfigureAwait(false);

            return(month);
        }
예제 #2
0
        /// <summary>
        /// Gets a months by its identifiyer
        /// </summary>
        /// <returns>A new instance of <see cref="IMonthDao"/></returns>
        public async Task <IMonthDao> GetMonthByIdAsync(MonthDto monthDto)
        {
            IMonthDao month = null;

            using (var connection = _connectionProvider())
            {
                month = await connection.QueryFirstAsync <MonthDao>(
                    MonthsQueries.GetMonthById,
                    new { monthID = monthDto.MonthId },
                    commandType : CommandType.StoredProcedure
                    ).ConfigureAwait(false);
            }

            return(month);
        }