public async Task <int> CreateLeccionAsync(LeccionEntity leccionEntity) { if (_dbConnection.State == ConnectionState.Closed) { _dbConnection.Open(); } var result = await _dbConnection.QueryAsync <int>("CreateLeccion", new { leccionEntity.Nombre, leccionEntity.Descripcion, leccionEntity.Puntaje, leccionEntity.IdCurso }, commandType : CommandType.StoredProcedure); return(result.FirstOrDefault()); }
public async Task <bool> UpdateLeccionAsync(LeccionEntity leccionEntity) { if (_dbConnection.State == ConnectionState.Closed) { _dbConnection.Open(); } var result = await _dbConnection.QueryAsync <int>("UpdateLeccion", new { leccionEntity.IdLeccion, leccionEntity.Nombre, leccionEntity.Descripcion, leccionEntity.ContenidoHTML, leccionEntity.Puntaje, leccionEntity.NumeroOrden, leccionEntity.IdCurso }, commandType : CommandType.StoredProcedure); return(result.FirstOrDefault() > default(int)); }