Beispiel #1
0
        public async Task UpdateBlockCycleAsync(BlockCycle blockCycle)
        {
            try
            {
                var param = new DynamicParameters();
                param.Add("BlockCycleId", blockCycle.BlockCycleId, dbType: DbType.Int32);
                param.Add("StartDate", blockCycle.StartDate, dbType: DbType.DateTime);
                param.Add("EndDate", blockCycle.EndDate, dbType: DbType.DateTime);

                _logger.LogInformation("Calling stored procedure [BlockCycle].[UpdateBlockCycle] with blockCycle : {@0}", blockCycle);
                await WithConnection(async c =>
                {
                    return(await c.ExecuteAsync("BlockCycle.UpdateBlockCycle", param, commandType: CommandType.StoredProcedure));
                });
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                throw new Exception(ex.Message);
            }
        }
 public async Task UpdateBlockCycleAsync(BlockCycle blockCycle)
 {
     await _blockCycleRepository.UpdateBlockCycleAsync(_mapper.Map <Infrastructure.Models.BlockCycle>(blockCycle));
 }